Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
test(test): fix the acceptance test after output format change
Browse files Browse the repository at this point in the history
re #51
  • Loading branch information
tamj0rd2 committed May 7, 2020
1 parent 9e341bd commit 9e7b2c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion acceptance-tests/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('ncdc test', () => {
expect(strip(output)).toContain(`info: PASSED: Shorts - ${REAL_SERVER_HOST}/api/resource`)
})

it.only('can test endpoints that return json', async () => {
it('can test endpoints that return json', async () => {
realServer = new RealServerBuilder().withGetEndpoint('/api/resource', 200, { hello: 'world' }).start()
new TestConfigWrapper().addConfig(
new ConfigBuilder()
Expand Down
6 changes: 3 additions & 3 deletions src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export const validationFailed = ({ name, problems }: ProblemResult): string =>
const testResult = (passed: boolean, name: string, suffix: string): string => {
const prefix = passed ? green('PASSED') : red.bold('FAILED')
const formattedName = passed ? name : red.bold(name)
return `${prefix}: ${formattedName}\n${suffix}\n`
return `${prefix}: ${formattedName} - ${suffix}\n`
}

export const testPassed = (name: string, endpoint: string): string =>
testResult(true, name, `URL: ${endpoint}`)
`${green('PASSED')}: ${name} - ${endpoint}\n`

export const testFailed = (name: string, endpoint: string, problems: Problem[]): string =>
`${testResult(false, name, `URL: ${endpoint}`)}\n${gatherValidationErrors(problems)}`
`${red.bold('FAILED')}: ${red.bold(name)}\nURL: ${endpoint}\n${gatherValidationErrors(problems)}`

export const testError = (name: string, message: string): string => testResult(false, name, message)

0 comments on commit 9e7b2c5

Please sign in to comment.