From ff182149f3e070409ddb69e955014524eff28c3e Mon Sep 17 00:00:00 2001 From: e-cloud Date: Mon, 12 Dec 2016 21:07:27 +0800 Subject: [PATCH] test(deps): upgrade vows and sandboxed-module to support node v7 add a missing dependency - axios. adjust tests to be compatible with latest sandboxed-module. --- .travis.yml | 1 + package.json | 7 +++++-- test/vows/clusteredAppender-test.js | 1 + test/vows/configuration-test.js | 13 ++++++++++--- test/vows/fileAppender-test.js | 1 + test/vows/gelfAppender-test.js | 1 + test/vows/log-abspath-test.js | 4 +++- test/vows/logstashUDP-test.js | 1 + test/vows/smtpAppender-test.js | 1 + 9 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0bcc354..21db349 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: node_js sudo: false node_js: + - "7" - "6" - "5" - "4" diff --git a/package.json b/package.json index 4a14284..22712da 100644 --- a/package.json +++ b/package.json @@ -42,10 +42,10 @@ "eslint-config-airbnb-base": "^11.0.0", "eslint-plugin-import": "^2.0.0", "ghooks": "^1.2.1", - "sandboxed-module": "0.3.0", + "sandboxed-module": "^2.0.3", "tape": "^4.6.2", "validate-commit-msg": "^2.6.1", - "vows": "0.7.0" + "vows": "0.8.0" }, "optionalDependencies": { "hipchat-notifier": "^1.1.0", @@ -83,5 +83,8 @@ }, "commit-msg": "validate-commit-msg" } + }, + "peerDependencies": { + "axios": "^0.15.3" } } diff --git a/test/vows/clusteredAppender-test.js b/test/vows/clusteredAppender-test.js index 5de0e4a..64b1f1b 100644 --- a/test/vows/clusteredAppender-test.js +++ b/test/vows/clusteredAppender-test.js @@ -115,6 +115,7 @@ vows.describe('log4js cluster appender').addBatch({ send: function(data) { registeredProcessEvents.push(data); }, + env: process.env }; diff --git a/test/vows/configuration-test.js b/test/vows/configuration-test.js index aa22f26..049f4cd 100644 --- a/test/vows/configuration-test.js +++ b/test/vows/configuration-test.js @@ -26,6 +26,7 @@ vows.describe('log4js configure').addBatch({ log4js = sandbox.require( '../../lib/log4js', { + singleOnly: true, requires: { './appenders/cheese': testAppender } @@ -56,9 +57,12 @@ vows.describe('log4js configure').addBatch({ var testAppender = makeTestAppender(), log4js = sandbox.require( '../../lib/log4js', - { requires: { './appenders/cheese': testAppender } } + { + singleOnly: true, + requires: { './appenders/cheese': testAppender } + } ); - + log4js.loadAppender('cheese'); return log4js; }, @@ -74,7 +78,10 @@ vows.describe('log4js configure').addBatch({ var testAppender = makeTestAppender(), log4js = sandbox.require( '../../lib/log4js', - { requires: { 'some/other/external': testAppender } } + { + singleOnly: true, + requires: { 'some/other/external': testAppender } + } ); log4js.loadAppender('some/other/external'); return log4js; diff --git a/test/vows/fileAppender-test.js b/test/vows/fileAppender-test.js index 8f45c7e..a5ec3d8 100644 --- a/test/vows/fileAppender-test.js +++ b/test/vows/fileAppender-test.js @@ -57,6 +57,7 @@ vows.describe('log4js fileAppender').addBatch({ } } }, + singleOnly: true, requires: { 'streamroller': { RollingFileStream: function(filename) { diff --git a/test/vows/gelfAppender-test.js b/test/vows/gelfAppender-test.js index 0ee79bb..bfbe43a 100644 --- a/test/vows/gelfAppender-test.js +++ b/test/vows/gelfAppender-test.js @@ -57,6 +57,7 @@ var vows = require('vows') messagePassThroughLayout: realLayouts.messagePassThroughLayout } , appender = sandbox.require('../../lib/appenders/gelf', { + singleOnly: true, requires: { dgram: fakeDgram, zlib: fakeZlib, diff --git a/test/vows/log-abspath-test.js b/test/vows/log-abspath-test.js index db45a0a..ee0c3b1 100644 --- a/test/vows/log-abspath-test.js +++ b/test/vows/log-abspath-test.js @@ -10,7 +10,9 @@ vows.describe('log4js-abspath').addBatch({ var appenderOptions, log4js = sandbox.require( '../../lib/log4js', - { requires: + { + singleOnly: true, + requires: { './appenders/fake': { name: "fake", appender: function() {}, diff --git a/test/vows/logstashUDP-test.js b/test/vows/logstashUDP-test.js index 0e2c050..66bf636 100644 --- a/test/vows/logstashUDP-test.js +++ b/test/vows/logstashUDP-test.js @@ -25,6 +25,7 @@ function setupLogging(category, options) { }; var logstashModule = sandbox.require('../../lib/appenders/logstashUDP', { + singleOnly: true, requires: { 'dgram': fakeDgram } diff --git a/test/vows/smtpAppender-test.js b/test/vows/smtpAppender-test.js index af5ccd9..6d4a5db 100644 --- a/test/vows/smtpAppender-test.js +++ b/test/vows/smtpAppender-test.js @@ -42,6 +42,7 @@ function setupLogging(category, options) { }; var smtpModule = sandbox.require('../../lib/appenders/smtp', { + singleOnly: true, requires: { 'nodemailer': fakeMailer, 'nodemailer-sendmail-transport': fakeTransportPlugin,