Comparing version 1.5.0 to 1.5.1
@@ -19,3 +19,5 @@ var _ = require('lodash'), | ||
E = '', | ||
DISPATCH_INTERFACE_FN = '_dispatch', | ||
ERROR_EVENT = 'error', | ||
DISCONNECT_EVENT = 'disconnect', | ||
DISPATCHQUEUE_EVENT = 'dispatchQueued', | ||
@@ -112,2 +114,7 @@ DISCONNECT_ERROR_MESSAGE = 'uvm: cannot disconnect, communication bridge is broken', | ||
disconnect: function () { | ||
// send disponse event if possible | ||
// @todo: this does not work where event dispatch is highly async (like in browser message passing) | ||
try { this.hasOwnProperty(DISPATCH_INTERFACE_FN) && this._dispatch(DISCONNECT_EVENT); } | ||
catch (e) { } // eslint-disable-line no-empty | ||
try { this._disconnect.apply(this, arguments); } | ||
@@ -114,0 +121,0 @@ catch (e) { this.emit(ERROR_EVENT, e); } |
@@ -13,4 +13,3 @@ #!/usr/bin/env node | ||
require('./test-integration'), | ||
// run the browser tests locally and not on CI | ||
process.env.CI ? async.constant() : require('./test-browser') | ||
require('./test-browser') | ||
], function (code) { | ||
@@ -17,0 +16,0 @@ !code && console.log(colors.green('\n' + require('../package.json').name + ' tests: all ok!')); |
{ | ||
"name": "uvm", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Universal Virtual Machine for Node and Browser", | ||
@@ -34,7 +34,8 @@ "main": "index.js", | ||
"devDependencies": { | ||
"async": "2.1.5", | ||
"async": "2.4.1", | ||
"browserify": "^14.3.0", | ||
"colors": "1.1.2", | ||
"editorconfig": "0.13.2", | ||
"eslint": "3.18.0", | ||
"eslint-plugin-jsdoc": "3.0.0", | ||
"eslint": "3.19.0", | ||
"eslint-plugin-jsdoc": "3.0.1", | ||
"eslint-plugin-mocha": "4.9.0", | ||
@@ -44,6 +45,6 @@ "eslint-plugin-security": "1.3.0", | ||
"istanbul": "0.4.5", | ||
"js-yaml": "3.8.2", | ||
"js-yaml": "3.8.4", | ||
"jsdoc": "3.4.3", | ||
"jsdoc-to-markdown": "3.0.0", | ||
"karma": "1.4.0", | ||
"karma": "1.6.0", | ||
"karma-browserify": "5.1.1", | ||
@@ -53,6 +54,6 @@ "karma-chrome-launcher": "2.0.0", | ||
"karma-mocha-reporter": "2.2.3", | ||
"mocha": "3.2.0", | ||
"mocha": "3.3.0", | ||
"nsp": "2.6.3", | ||
"packity": "0.3.2", | ||
"parse-gitignore": "0.3.1", | ||
"parse-gitignore": "0.4.0", | ||
"recursive-readdir": "^2.1.0", | ||
@@ -59,0 +60,0 @@ "shelljs": "0.7.7" |
@@ -5,3 +5,3 @@ // Karma configuration | ||
module.exports = function (config) { | ||
config.set({ | ||
var configuration = { | ||
@@ -72,3 +72,15 @@ // base path that will be used to resolve all patterns (eg. files, exclude) | ||
} | ||
}); | ||
}; | ||
if (process.env.TRAVIS) { | ||
configuration.customLaunchers = { | ||
chromeTravis: { | ||
base: 'Chrome', | ||
flags: ['--no-sandbox'] | ||
} | ||
}; | ||
configuration.browsers = ['chromeTravis']; | ||
} | ||
config.set(configuration); | ||
}; |
@@ -26,2 +26,6 @@ /* global describe, it */ | ||
describe('strucure', function () { | ||
it('should use the trusty Ubuntu distribution', function () { | ||
expect(travisYAML.dist).to.be('trusty'); | ||
}); | ||
it('should have the language set to node', function () { | ||
@@ -32,2 +36,12 @@ expect(travisYAML.language).to.be('node_js'); | ||
it('should use Google Chrome as an added package', function () { | ||
expect(travisYAML.addons).to.eql({apt: {packages: ['google-chrome-stable']}}); | ||
}); | ||
it('should have a valid before_install sequence', function () { | ||
expect(travisYAML.before_install).to.eql([ | ||
'export CHROME_BIN=google-chrome', 'export DISPLAY=:99.0', 'sh -e /etc/init.d/xvfb start', 'sleep 3' | ||
]); | ||
}); | ||
it('should have a valid Slack notification token', function () { | ||
@@ -34,0 +48,0 @@ expect(travisYAML.notifications.slack.secure).to.be.ok(); |
@@ -1,2 +0,3 @@ | ||
var async = require('async'); | ||
var async = require('async'), | ||
isNode = (typeof window === 'undefined'); | ||
@@ -51,3 +52,3 @@ describe('uvm', function () { | ||
((typeof window === 'undefined') ? it : it.skip)('must pass load error on broken boot code', function (done) { | ||
(isNode ? it : it.skip)('must pass load error on broken boot code', function (done) { | ||
uvm.spawn({ | ||
@@ -142,3 +143,19 @@ bootCode: ` | ||
}); | ||
(isNode ? it : it.skip)('must trigger disconnection event before disconnecting in node', function (done) { | ||
uvm.spawn({ | ||
bootCode: ` | ||
bridge.on('disconnect', function () { | ||
bridge.dispatch('disconnect.ack'); | ||
}); | ||
` | ||
}, function (err, context) { | ||
expect(err).not.be.an('object'); | ||
context.on('error', done); | ||
context.on('disconnect.ack', done); | ||
context.disconnect(); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
113815
43
1833
10
24