Skip to content

Commit

Permalink
chore: update ci, remove package and add jest timeout bdd (#7)
Browse files Browse the repository at this point in the history
* chore: update ci, remove package and add jest timeout bdd

* chore: remove spacing and timeout
  • Loading branch information
kleyow authored Mar 2, 2021
1 parent 50b800d commit 07f85e2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 161 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@ workflows:
- build-local
- test-unit
- test-coverage
- test-integration
- test-bdd
filters:
tags:
only: /.*/
Expand Down
152 changes: 0 additions & 152 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"audit:resolve": "SHELL=sh resolve-audit --production",
"audit:check": "SHELL=sh check-audit --production",
"build": "tsc -p ./tsconfig.build.json",
"build:openapi": "openapi bundle --output ./src/interface/api.yaml --ext yaml ./src/interface/api-template.yaml",
"build:openapi": "openapi bundle --output ./src/interface/api.yaml --ext yaml ./src/interface/api-template.yaml",
"docker:build": "docker build -t als-consent-oracle:local -f ./Dockerfile ./",
"docker:run": "docker run -p 3000:3000 als-consent-oracle:local",
"lint": "eslint ./src/**/*.ts *.js",
Expand Down Expand Up @@ -103,7 +103,6 @@
"npm-check-updates": "11.0.0",
"source-map-support": "0.5.19",
"standard-version": "^9.1.0",
"swagger-cli": "^4.0.4",
"ts-jest": "^26.4.4",
"tsconfig-paths": "^3.9.0",
"typescript": "4.1.3"
Expand Down
16 changes: 9 additions & 7 deletions test/step-definitions/participants.step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Config from '~/shared/config'
import * as Domain from '~/domain/participants'

import OracleServer from '../../src/server'
import { Consent } from '~/model/consent';
import { Consent } from '~/model/consent'
import Headers from '../data/headers.json'

const mockRetrieveConsent = jest.spyOn(Domain, 'retrieveConsent')
Expand All @@ -20,6 +20,8 @@ const retrievedConsent: Consent = {
const featurePath = path.join(__dirname, '../features/participants.scenario.feature')
const feature = loadFeature(featurePath)

jest.setTimeout(10 * 1000) // 10 seconds

defineFeature(feature, (test): void => {
let server: Server
let response: ServerInjectResponse
Expand Down Expand Up @@ -65,8 +67,8 @@ defineFeature(feature, (test): void => {
url: '/participants/CONSENT/fb2f2b12-5107-48f1-a93d-52b154270038',
headers: Headers,
payload: {
"currency": "USD",
"fspId": "dfspa"
currency: 'USD',
fspId: 'dfspa'
}
}
response = await server.inject(request)
Expand All @@ -76,7 +78,7 @@ defineFeature(feature, (test): void => {
then('I respond with a 201 Created', (): void => {
expect(response.statusCode).toBe(201)
expect(mockCreateConsent).toBeCalledWith(
{"fspId": "dfspa", "id": "fb2f2b12-5107-48f1-a93d-52b154270038"}
{ fspId: 'dfspa', id: 'fb2f2b12-5107-48f1-a93d-52b154270038' }
)
})
})
Expand All @@ -94,8 +96,8 @@ defineFeature(feature, (test): void => {
url: '/participants/CONSENT/fb2f2b12-5107-48f1-a93d-52b154270038',
headers: Headers,
payload: {
"currency": "USD",
"fspId": "dfspa"
currency: 'USD',
fspId: 'dfspa'
}
}
response = await server.inject(request)
Expand All @@ -105,7 +107,7 @@ defineFeature(feature, (test): void => {
then('I respond with a 200 OK', (): void => {
expect(response.statusCode).toBe(200)
expect(mockUpdateConsent).toBeCalledWith(
{"fspId": "dfspa", "id": "fb2f2b12-5107-48f1-a93d-52b154270038"}
{ fspId: 'dfspa', id: 'fb2f2b12-5107-48f1-a93d-52b154270038' }
)
})
})
Expand Down
2 changes: 2 additions & 0 deletions test/step-definitions/template.step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import OracleServer from '../../src/server'
const featurePath = path.join(__dirname, '../features/template.scenario.feature')
const feature = loadFeature(featurePath)

jest.setTimeout(10 * 1000) // 10 seconds

defineFeature(feature, (test): void => {
let server: Server
let response: ServerInjectResponse
Expand Down

0 comments on commit 07f85e2

Please sign in to comment.