From ec2175b17bd1f2ecdb479c66fab8a01666d6da3a Mon Sep 17 00:00:00 2001 From: Johannes Ewald Date: Sat, 11 Nov 2017 02:48:54 +0100 Subject: Update .travis.yml Remove unsupported node versions --- .travis.yml | 5 ++--- lib/moduleEnv.js | 15 --------------- test/rewire.test.js | 2 +- testLib/constModule.js | 6 +++--- testLib/sharedTestCases.js | 4 ++-- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b15e35..5f98a89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ language: node_js node_js: - - "0.10" - - "0.12" - "4" - - "5" - "6" + - "8" + - "9" script: - npm test diff --git a/lib/moduleEnv.js b/lib/moduleEnv.js index 09bfd39..789ea2f 100644 --- a/lib/moduleEnv.js +++ b/lib/moduleEnv.js @@ -26,21 +26,6 @@ function load(targetModule) { reset(); } -function compileJavaScript(src, targetPath) { - return babelCore.transform(stripBOM(src), { - plugins: [transformBlockScoping], - retainLines: true, - filename: targetPath - }).code; -} - -function compileCoffeeScript(src, targetPath) { - return coffee.compile(stripBOM(src), { - filename: targetPath, - bare: true - }); -} - function reset() { Module.wrapper[0] = moduleWrapper0; Module.wrapper[1] = moduleWrapper1; diff --git a/test/rewire.test.js b/test/rewire.test.js index 4d3b985..b6e1499 100644 --- a/test/rewire.test.js +++ b/test/rewire.test.js @@ -16,7 +16,7 @@ describe("rewire", function () { fs.renameSync(fakeNodeModules, path.resolve(__dirname, "../testLib/node_modules")); } }); - require("../testLib/sharedTestCases.js"); + require("../testLib/sharedTestCases.js")(); it("should also work with CoffeeScript", function () { var coffeeModule; diff --git a/testLib/constModule.js b/testLib/constModule.js index 042b797..77396d9 100644 --- a/testLib/constModule.js +++ b/testLib/constModule.js @@ -1,13 +1,13 @@ const someOtherModule = require("./someOtherModule"); const language = "nl"; -module.exports.getLang = () => { +exports.getLang = () => { return language; -} +}; exports.getOtherModuleName = () => { return someOtherModule.name; -} +}; exports.filename = __filename; exports.dirname = __dirname; diff --git a/testLib/sharedTestCases.js b/testLib/sharedTestCases.js index 06dcb11..b6caf6a 100644 --- a/testLib/sharedTestCases.js +++ b/testLib/sharedTestCases.js @@ -17,7 +17,7 @@ function checkForTypeError(err) { expect(err.constructor).to.be(TypeError); } -describe(typeof testEnv === "undefined"? "(node)": "(" + testEnv + ")", function () { +module.exports = function () { it("should work like require()", function () { rewire("./moduleA.js").getFilename(); @@ -390,4 +390,4 @@ describe(typeof testEnv === "undefined"? "(node)": "(" + testEnv + ")", function expect(constModule.dirname).to.equal(require("./constModule").dirname); }); -}); +}; -- cgit v1.2.3