Skip to content

Commit

Permalink
chore: fix tests stucked waiting on wrong url (#241)
Browse files Browse the repository at this point in the history
* chore: fix tests stucked waiting on wrong url

* chore: debug failing tests on CI

* chore: remove debug output

* chore: fix tests
  • Loading branch information
wa0x6e authored Mar 23, 2024
1 parent b66c51a commit d512c10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"dev": "nodemon src/index.ts -e js,ts",
"start": "node dist/src/index.js",
"start:test": "dotenv -e test/.env.test yarn dev",
"test": "PORT=3003 start-server-and-test 'yarn start:test' 3003 'dotenv -e test/.env.test jest --runInBand'",
"test": "PORT=3003 start-server-and-test 'yarn start:test' http://localhost:3003 'dotenv -e test/.env.test jest --runInBand'",
"test:unit": "dotenv -e test/.env.test jest test/unit/",
"test:integration": "dotenv -e test/.env.test jest test/integration/",
"test:e2e": "PORT=3003 start-server-and-test 'yarn start:test' 3003 'dotenv -e test/.env.test jest --runInBand --collectCoverage=false test/e2e/'",
"test:e2e:update-snapshot": "PORT=3003 start-server-and-test 'yarn start:test' 3003 'dotenv -e test/.env.test jest --runInBand --collectCoverage=false --updateSnapshot test/e2e/'"
"test:e2e": "PORT=3003 start-server-and-test 'yarn start:test' http://localhost:3003 'dotenv -e test/.env.test jest --runInBand --collectCoverage=false test/e2e/'",
"test:e2e:update-snapshot": "PORT=3003 start-server-and-test 'yarn start:test' http://localhost:3003 'dotenv -e test/.env.test jest --runInBand --collectCoverage=false --updateSnapshot test/e2e/'"
},
"eslintConfig": {
"extends": "@snapshot-labs"
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/votesReport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ describe('GET /api/votes/:id', () => {
const votesReport = new VotesReport(id, storage);

beforeAll(async () => {
await votesReport.createCache();
try {
await votesReport.createCache();
} catch (e) {
console.error('Error while creating the cache');
}
});

it('returns the cached file', async () => {
Expand Down

0 comments on commit d512c10

Please sign in to comment.