* chore(deps-dev): bump prettier from 2.8.8 to 3.0.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * reformat all the things (prettier 3) * update tests to await calls to prettier.format() --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: chris48s <git@chris-shaw.dev>
78 lines
1.8 KiB
JavaScript
78 lines
1.8 KiB
JavaScript
import { createServiceTester } from '../tester.js'
|
|
export const t = await createServiceTester()
|
|
const label = 'hsts preloaded'
|
|
|
|
t.create('gets the hsts status of github').get('/github.com.json').expectBadge({
|
|
label,
|
|
message: 'yes',
|
|
color: 'brightgreen',
|
|
})
|
|
|
|
t.create('gets the hsts status of httpforever')
|
|
.get('/httpforever.com.json')
|
|
.expectBadge({
|
|
label,
|
|
message: 'no',
|
|
color: 'red',
|
|
})
|
|
|
|
t.create('gets the status of an invalid uri')
|
|
.get('/does-not-exist.json')
|
|
.expectBadge({
|
|
label,
|
|
message: 'no',
|
|
color: 'red',
|
|
})
|
|
|
|
t.create('gets the hsts status of github (mock)')
|
|
.get('/github.com.json')
|
|
.intercept(nock =>
|
|
nock('https://hstspreload.org')
|
|
.get('/api/v2/status?domain=github.com')
|
|
.reply(200, { status: 'preloaded' }),
|
|
)
|
|
.expectBadge({
|
|
label,
|
|
message: 'yes',
|
|
color: 'brightgreen',
|
|
})
|
|
|
|
t.create('gets the hsts status of httpforever (mock)')
|
|
.get('/httpforever.com.json')
|
|
.intercept(nock =>
|
|
nock('https://hstspreload.org')
|
|
.get('/api/v2/status?domain=httpforever.com')
|
|
.reply(200, { status: 'unknown' }),
|
|
)
|
|
.expectBadge({
|
|
label,
|
|
message: 'no',
|
|
color: 'red',
|
|
})
|
|
|
|
t.create('gets the hsts status of a pending site (mock)')
|
|
.get('/pending.mock.json')
|
|
.intercept(nock =>
|
|
nock('https://hstspreload.org')
|
|
.get('/api/v2/status?domain=pending.mock')
|
|
.reply(200, { status: 'pending' }),
|
|
)
|
|
.expectBadge({
|
|
label,
|
|
message: 'pending',
|
|
color: 'yellow',
|
|
})
|
|
|
|
t.create('gets the status of an invalid uri (mock)')
|
|
.get('/does-not-exist.json')
|
|
.intercept(nock =>
|
|
nock('https://hstspreload.org')
|
|
.get('/api/v2/status?domain=does-not-exist')
|
|
.reply(200, { status: 'unknown' }),
|
|
)
|
|
.expectBadge({
|
|
label,
|
|
message: 'no',
|
|
color: 'red',
|
|
})
|