Skip to content

Commit

Permalink
Fix JS formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins committed Sep 6, 2023
1 parent 816f09c commit ead4d3d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
21 changes: 13 additions & 8 deletions services/flakehub/flakehub.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ export default class FlakeHub extends BaseJsonService {
'/flakehub/flake/{org}/{project}': {
get: {
summary: 'FlakeHub flake version',
parameters: pathParams({
name: 'org',
example: 'DeterminateSystems',
}, {
name: 'project',
example: 'flake-schemas'
}),
parameters: pathParams(
{
name: 'org',
example: 'DeterminateSystems',
},
{
name: 'project',
example: 'flake-schemas',
},
),
},
},
}
Expand All @@ -29,7 +32,9 @@ export default class FlakeHub extends BaseJsonService {
async handle({ org, project }) {
const data = await this._requestJson({
schema,
url: `https://api.flakehub.com/badge/${encodeURIComponent(org)}/${encodeURIComponent(project)}`,
url: `https://api.flakehub.com/badge/${encodeURIComponent(
org,
)}/${encodeURIComponent(project)}`,
})

// the upstream API indicates "not found"
Expand Down
12 changes: 7 additions & 5 deletions services/flakehub/flakehub.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ import { isVPlusDottedVersionNClauses } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()

t.create('FlakeHub (valid)').get('/flake/DeterminateSystems/nuenv').expectBadge({
label: 'flakehub',
message: isVPlusDottedVersionNClauses,
})
t.create('FlakeHub (valid)')
.get('/flake/DeterminateSystems/nuenv')
.expectBadge({
label: 'flakehub',
message: isVPlusDottedVersionNClauses,
})

t.create('FlakeHub (valid)')
.get('/flake/DeterminateSystems/nuenv')
.intercept(nock =>
nock('https://api.flakehub.com')
.get('/badge/DeterminateSystems/nuenv')
.reply(200, {
latest: '0.1.160'
latest: '0.1.160',
}),
)
.expectBadge({ label: 'flakehub', message: '0.1.160' })
Expand Down

0 comments on commit ead4d3d

Please sign in to comment.