Skip to content

Commit

Permalink
chore: force Jest to exit if a process is still running
Browse files Browse the repository at this point in the history
  • Loading branch information
louistiti committed Apr 3, 2021
1 parent 4cddb70 commit 86dd7fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"scripts": {
"lint": "babel-node scripts/lint.js",
"test": "npm run test:json && npm run test:unit && npm run test:e2e",
"test:unit": "npm run train expressions:en && cross-env PIPENV_PIPFILE=bridges/python/Pipfile jest --silent --projects test/unit/unit.jest.json && npm run train expressions",
"test:unit": "npm run train expressions:en && cross-env PIPENV_PIPFILE=bridges/python/Pipfile jest --forceExit --silent --projects test/unit/unit.jest.json && npm run train expressions",
"test:e2e": "npm run test:e2e:nlp-modules && npm run test:e2e:modules",
"test:e2e:modules": "npm run train expressions:en && cross-env PIPENV_PIPFILE=bridges/python/Pipfile jest --silent --verbose --projects test/e2e/modules/e2e.modules.jest.json && npm run train expressions",
"test:e2e:nlp-modules": "npm run train expressions:en && cross-env PIPENV_PIPFILE=bridges/python/Pipfile jest --silent --verbose --setupTestFrameworkScriptFile=./test/paths.setup.js test/e2e/nlp-modules.spec.js && npm run train expressions",
"test:e2e:modules": "npm run train expressions:en && cross-env PIPENV_PIPFILE=bridges/python/Pipfile jest --forceExit --silent --verbose --projects test/e2e/modules/e2e.modules.jest.json && npm run train expressions",
"test:e2e:nlp-modules": "npm run train expressions:en && cross-env PIPENV_PIPFILE=bridges/python/Pipfile jest --forceExit --silent --verbose --setupTestFrameworkScriptFile=./test/paths.setup.js test/e2e/nlp-modules.spec.js && npm run train expressions",
"test:json": "jest --silent --projects test/json/json.jest.json",
"test:module": "babel-node scripts/test-module.js",
"setup:offline": "babel-node scripts/setup-offline/setup-offline.js",
Expand Down
4 changes: 3 additions & 1 deletion test/unit/server/core/server.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ describe('server', () => {
ee.emit('recognize', 'blob')
}, 150)

setTimeout(() => {
setTimeout(async () => {
expect(console.log.mock.calls[0][1]).toBe('ASR')
console.log = jest.fn()

await server.httpServer.close()

done()
}, 200)
})
Expand Down

0 comments on commit 86dd7fa

Please sign in to comment.