1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-11-28 04:04:58 +03:00

chore: force Jest to exit if a process is still running

This commit is contained in:
louistiti 2021-04-03 11:43:55 +08:00
parent 4cddb702f2
commit 86dd7fae91
No known key found for this signature in database
GPG Key ID: 7ECA3DD523793FE6
2 changed files with 6 additions and 4 deletions

View File

@ -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",

View File

@ -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)
})