Comparing version 5.1.1 to 5.2.0
@@ -11,3 +11,2 @@ 'use strict' | ||
const BundleUtils = require('./utils/bundle-utils') | ||
const NetUtils = require('./utils/net-utils') | ||
@@ -120,6 +119,2 @@ const root = global || window || this | ||
try { | ||
await Promise.all([ | ||
BundleUtils.bundleResourceIfNotExist('client/main.js', 'static/karma.js'), | ||
BundleUtils.bundleResourceIfNotExist('context/main.js', 'static/context.js') | ||
]) | ||
this._boundServer = await NetUtils.bindAvailablePort(config.port, config.listenAddress) | ||
@@ -152,2 +147,31 @@ this._boundServer.on('connection', (socket) => { | ||
emitExitAsync (code) { | ||
const name = 'exit' | ||
let pending = this.listeners(name).length | ||
const deferred = helper.defer() | ||
function resolve () { | ||
deferred.resolve(code) | ||
} | ||
try { | ||
this.emit(name, (newCode) => { | ||
if (newCode && typeof newCode === 'number') { | ||
// Only update code if it is given and not zero | ||
code = newCode | ||
} | ||
if (!--pending) { | ||
resolve() | ||
} | ||
}) | ||
if (!pending) { | ||
resolve() | ||
} | ||
} catch (err) { | ||
deferred.reject(err) | ||
} | ||
return deferred.promise | ||
} | ||
async _start (config, launcher, preprocess, fileList, capturedBrowsers, executor, done) { | ||
@@ -197,3 +221,6 @@ if (config.detached) { | ||
fileList.refresh().then(afterPreprocess, afterPreprocess) | ||
fileList.refresh().then(afterPreprocess, (err) => { | ||
this.log.error('Error during file loading or preprocessing\n' + err.stack || err) | ||
afterPreprocess() | ||
}) | ||
@@ -305,3 +332,4 @@ this.on('browsers_change', () => socketServer.sockets.emit('info', capturedBrowsers.serialize())) | ||
this.log.debug('Received stop event, exiting.') | ||
return disconnectBrowsers().then(done) | ||
disconnectBrowsers() | ||
done() | ||
}) | ||
@@ -364,24 +392,25 @@ | ||
let removeAllListenersDone = false | ||
const removeAllListeners = () => { | ||
if (removeAllListenersDone) { | ||
return | ||
this.emitExitAsync(code).catch((err) => { | ||
this.log.error('Error while calling exit event listeners\n' + err.stack || err) | ||
return 1 | ||
}).then((code) => { | ||
socketServer.sockets.removeAllListeners() | ||
socketServer.close() | ||
let removeAllListenersDone = false | ||
const removeAllListeners = () => { | ||
if (removeAllListenersDone) { | ||
return | ||
} | ||
removeAllListenersDone = true | ||
webServer.removeAllListeners() | ||
processWrapper.removeAllListeners() | ||
done(code || 0) | ||
} | ||
removeAllListenersDone = true | ||
webServer.removeAllListeners() | ||
processWrapper.removeAllListeners() | ||
done(code || 0) | ||
} | ||
return this.emitAsync('exit').then(() => { | ||
return new Promise((resolve, reject) => { | ||
socketServer.sockets.removeAllListeners() | ||
socketServer.close() | ||
const closeTimeout = setTimeout(removeAllListeners, webServerCloseTimeout) | ||
const closeTimeout = setTimeout(removeAllListeners, webServerCloseTimeout) | ||
webServer.close(() => { | ||
clearTimeout(closeTimeout) | ||
removeAllListeners() | ||
resolve() | ||
}) | ||
webServer.close(() => { | ||
clearTimeout(closeTimeout) | ||
removeAllListeners() | ||
}) | ||
@@ -388,0 +417,0 @@ }) |
@@ -395,3 +395,3 @@ { | ||
"braces": "^3.0.2", | ||
"chokidar": "^3.0.0", | ||
"chokidar": "^3.4.2", | ||
"colors": "^1.4.0", | ||
@@ -401,3 +401,2 @@ "connect": "^3.7.0", | ||
"dom-serialize": "^2.2.1", | ||
"flatted": "^2.0.2", | ||
"glob": "^7.1.6", | ||
@@ -407,3 +406,3 @@ "graceful-fs": "^4.2.4", | ||
"isbinaryfile": "^4.0.6", | ||
"lodash": "^4.17.15", | ||
"lodash": "^4.17.19", | ||
"log4js": "^6.2.1", | ||
@@ -416,3 +415,3 @@ "mime": "^2.4.5", | ||
"socket.io": "^2.3.0", | ||
"source-map": "^0.6.1", | ||
"source-map": "^0.7.3", | ||
"tmp": "0.2.1", | ||
@@ -433,9 +432,10 @@ "ua-parser-js": "0.7.21", | ||
"cucumber": "^6.0.5", | ||
"eslint": "^7.0.0", | ||
"eslint": "^7.6.0", | ||
"eslint-config-standard": "^14.1.1", | ||
"eslint-plugin-import": "^2.20.2", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"grunt": "^1.1.0", | ||
"flatted": "^2.0.2", | ||
"grunt": "^1.2.1", | ||
"grunt-auto-release": "^0.0.7", | ||
@@ -452,11 +452,11 @@ "grunt-browserify": "^5.0.0", | ||
"http2": "^3.3.6", | ||
"husky": "^4.0.3", | ||
"jasmine-core": "^3.4.0", | ||
"husky": "^4.2.5", | ||
"jasmine-core": "^3.6.0", | ||
"karma-browserify": "^7.0.0", | ||
"karma-browserstack-launcher": "^1.5.0", | ||
"karma-browserstack-launcher": "^1.6.0", | ||
"karma-chai": "^0.1.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-firefox-launcher": "*", | ||
"karma-firefox-launcher": "^1.3.0", | ||
"karma-jasmine": "^2.0.1", | ||
"karma-junit-reporter": "*", | ||
"karma-junit-reporter": "^2.0.1", | ||
"karma-mocha": "^1.0.1", | ||
@@ -469,7 +469,7 @@ "karma-mocha-reporter": "^2.0.0", | ||
"mocks": "^0.0.15", | ||
"proxyquire": "^2.1.0", | ||
"puppeteer": "^1.9.0", | ||
"proxyquire": "^2.1.3", | ||
"puppeteer": "^1.20.0", | ||
"semantic-release": "^15.14.0", | ||
"sinon": "^7.3.2", | ||
"sinon-chai": "^3.0.0", | ||
"sinon": "7.3.2", | ||
"sinon-chai": "^3.5.0", | ||
"supertest": "^4.0.2", | ||
@@ -486,3 +486,3 @@ "timer-shim": "^0.3.0", | ||
}, | ||
"version": "5.1.1", | ||
"version": "5.2.0", | ||
"license": "MIT", | ||
@@ -502,3 +502,4 @@ "husky": { | ||
"test": "npm run test:unit && npm run test:e2e && npm run test:client", | ||
"build": "grunt build", | ||
"build": "node scripts/client.js build", | ||
"build:check": "node scripts/client.js check", | ||
"test:appveyor": "grunt test-appveyor", | ||
@@ -510,5 +511,4 @@ "test:integration": "./scripts/integration-tests.sh", | ||
"init:windows": "(IF EXIST node_modules\\karma (rmdir node_modules\\karma /S /q)) && npm run link", | ||
"appveyor": "npm run build && npm run test:appveyor", | ||
"semantic-release": "semantic-release" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
501516
23
10397
53
22
+ Addedsource-map@0.7.4(transitive)
- Removedflatted@^2.0.2
- Removedflatted@2.0.2(transitive)
- Removedsource-map@0.6.1(transitive)
Updatedchokidar@^3.4.2
Updatedlodash@^4.17.19
Updatedsource-map@^0.7.3