Skip to content

Commit

Permalink
Merge pull request #107 from ahwayakchih/fix-loading-relative-path
Browse files Browse the repository at this point in the history
fix: loading relative path
  • Loading branch information
ahwayakchih authored Apr 17, 2019
2 parents afbc5d4 + c0b10da commit 4135ebf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: "**"
});
}
Expand Down
13 changes: 12 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 4135ebf

Please sign in to comment.