Files
shields/services/github/github-manifest.tester.js
dependabot[bot] b9d96755ec chore(deps-dev): bump prettier from 2.8.8 to 3.0.0 (#9357)
* 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>
2023-07-10 09:27:51 +00:00

60 lines
1.7 KiB
JavaScript

import Joi from 'joi'
import { ServiceTester } from '../tester.js'
import { isVPlusDottedVersionAtLeastOne } from '../test-validators.js'
export const t = new ServiceTester({
id: 'GithubManifest',
title: 'GithubManifest',
pathPrefix: '/github/manifest-json',
})
t.create('Manifest version')
.get('/v/sindresorhus/show-all-github-issues.json')
.expectBadge({
label: 'version',
message: isVPlusDottedVersionAtLeastOne,
})
t.create('Manifest version (path)')
.get('/v/RedSparr0w/IndieGala-Helper.json?filename=extension/manifest.json')
.expectBadge({
label: 'version',
message: isVPlusDottedVersionAtLeastOne,
})
t.create('Manifest version (path not found)')
.get(
'/v/RedSparr0w/IndieGala-Helper.json?filename=invalid-directory/manifest.json',
)
.expectBadge({
label: 'version',
message:
'repo not found, branch not found, or invalid-directory/manifest.json missing',
})
t.create('Manifest name (path)')
.get('/n/RedSparr0w/IndieGala-Helper.json?filename=extension/manifest.json')
.expectBadge({ label: 'name', message: 'IndieGala Helper' })
t.create('Manifest array (path)')
.get(
'/permissions/RedSparr0w/IndieGala-Helper.json?filename=extension/manifest.json',
)
.expectBadge({
label: 'permissions',
message: Joi.string().regex(/.*?,/),
})
t.create('Manifest object (path)')
.get(
'/background/RedSparr0w/IndieGala-Helper.json?filename=extension/manifest.json',
)
.expectBadge({ label: 'manifest', message: 'invalid key value' })
t.create('Manifest invalid json response')
.get('/v/RedSparr0w/not-a-real-project.json')
.expectBadge({
label: 'version',
message: 'repo not found, branch not found, or manifest.json missing',
})