From dd518ba4924da5374afddd9571b6ee16b997b090 Mon Sep 17 00:00:00 2001 From: FND Date: Sat, 10 Feb 2018 13:58:21 +0100 Subject: [PATCH] fixed misleading test this was forgotten in 8d4db7ed9271c797948c96e86bb63eb4aa4e7b8c note that this reveals an inconsistency within faucet-core WRT how module paths are handled between Node versions: legacy mode (Node v6) does not fall back to relative paths while non-legacy mode (Node v8) does attempt to use relative paths if no corresponding package path exists --- package.json | 2 +- test/unit/test_bundling.js | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6f14abf..35c8c02 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "babel-core": "^6.26", "faucet-pipeline": "1.0.0-beta.0", "mkdirp": "^0.5.1", - "rollup": "^0.55.4", + "rollup": "^0.55.5", "rollup-plugin-commonjs": "^8.3.0", "rollup-plugin-node-resolve": "^3.0.2" }, diff --git a/test/unit/test_bundling.js b/test/unit/test_bundling.js index 66f5b3b..1ed04eb 100644 --- a/test/unit/test_bundling.js +++ b/test/unit/test_bundling.js @@ -281,17 +281,19 @@ console.log("[\\u2026] " + util); // eslint-disable-line no-console }); }); - it("should balk at non-relative paths in config", () => { + it("should balk at non-relative paths for target", () => { let assetManager = new MockAssetManager(FIXTURES_DIR); let entryPoint = "src/index.js"; let target = "dist/bundle.js"; let compile = (source, target) => faucetJS([{ source, target }], assetManager); - let fn = _ => compile(entryPoint, target); + let fn = _ => compile(`./${entryPoint}`, target); assert.throws(fn, /path must be relative/); - fn = _ => compile(`./${entryPoint}`, target); - assert.throws(fn, /path must be relative/); + // non-relative path is acceptable for entry point, but a suitable + // package path does not exist + fn = _ => compile(entryPoint, `./${target}`); + assert.throws(fn, /could not resolve/); return compile(`./${entryPoint}`, `./${target}`); });