Skip to content

Commit

Permalink
Test that the 'glob' option is honored
Browse files Browse the repository at this point in the history
This tests the glob options. Now that the coverage is high enough, going
to close out #1 with this.
  • Loading branch information
matthewp committed Mar 3, 2017
1 parent c53561a commit 3617b31
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports.stubExportPackager = function(stealElectron, buildResult){
};
};

exports.setup = function(projectPath){
exports.setup = function(projectPath, setup){
before(function(done){
this.oldPackageJSON = readFile(path.join(projectPath, "package.json"));

Expand All @@ -63,6 +63,11 @@ exports.setup = function(projectPath){
}
};

// Allow overriding stuff
if(setup) {
setup(electronOptions, buildResult);
}

exports.stubExportPackager(stealElectron, buildResult);

var fin = function() { done(); }
Expand Down
12 changes: 12 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ describe("steal-electron", function(){
});
});

describe("A normal application - using glob config", function(){
helpers.setup(__dirname + "/tests/app", function(options){
options.glob = options.files.concat(["some-file.js"]);
delete options.files;
});

it("Copies over files part of that glob", function(){
assert(exists(__dirname + "/tests/app/build/test/tests/app/production.html"));
assert(exists(__dirname + "/tests/app/build/test/tests/app/some-file.js"));
});
});

describe("An app with no steal.electron", function(){
helpers.setup(__dirname + "/tests/app2");

Expand Down
Empty file added test/tests/app/some-file.js
Empty file.

0 comments on commit 3617b31

Please sign in to comment.