diff --git a/src/resolver.js b/src/resolver.js index 07e531d..df4419a 100644 --- a/src/resolver.js +++ b/src/resolver.js @@ -7,7 +7,7 @@ module.exports = function resolve(pathOrFiles) { // legacy and original mode if (typeof pathOrFiles === "string") { return resolve({ - path: pathOrFiles, + path: path.resolve(pathOrFiles), src: "**" }); } diff --git a/test/index.js b/test/index.js index 5db83ae..1d7733b 100644 --- a/test/index.js +++ b/test/index.js @@ -31,10 +31,21 @@ TESTS.ChromeExtension = function(t, opts){ TESTS.load = function(t, opts){ - t.plan(4); + t.plan(6); newCrx(opts).load().then(t.pass); + // Test relative path + newCrx().load("./test/myFirstExtension").then(function(crx){ + t.ok(crx); + }).catch(t.error.bind(t)); + + // Test absolute path + newCrx().load(join(__dirname, "myFirstExtension")).then(function(crx){ + t.ok(crx); + }).catch(t.error.bind(t)); + + // Test list of files var fileList = [ 'test/myFirstExtension/manifest.json', 'test/myFirstExtension/icon.png',