Skip to content

Commit

Permalink
Updated tests to use the new CodeEngine syntax, such as `engine.run()…
Browse files Browse the repository at this point in the history
…` instead of `engine.build()`
  • Loading branch information
JamesMessinger committed Jan 17, 2020
1 parent f19d3fc commit 860251e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion test/specs/clean.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("plugin.clean()", () => {
let engine = new CodeEngine({ cwd });
await engine.use(source, destination);
await engine.clean();
await engine.build();
await engine.run();

// Make sure the output directory contains exactly what we expect
expect(cwd).to.have.deep.files([
Expand Down
4 changes: 2 additions & 2 deletions test/specs/filter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("filter option", () => {

let engine = new CodeEngine({ cwd });
await engine.use(source, destination);
await engine.build();
await engine.run();
}

it("should write all files by default", async () => {
Expand Down Expand Up @@ -187,7 +187,7 @@ describe("filter option", () => {
path: ".",
filter (file, context) {
expect(file).to.be.a("file");
expect(context).to.be.an("object").and.include.keys("cwd", "dev", "debug", "fullBuild");
expect(context).to.be.an("object").and.include.keys("cwd", "concurrency", "dev", "debug");

return file.name.includes("index.html");
},
Expand Down
8 changes: 4 additions & 4 deletions test/specs/fs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("fs option", () => {

let engine = new CodeEngine();
await engine.use(source, destination);
await engine.build();
await engine.run();

sinon.assert.notCalled(myCustomFS.mkdir);
sinon.assert.callCount(myCustomFS.writeFile, 4);
Expand Down Expand Up @@ -97,7 +97,7 @@ describe("fs option", () => {

let engine = new CodeEngine();
await engine.use(source, destination);
await engine.build();
await engine.run();

sinon.assert.callCount(myCustomFS.mkdir, 3);

Expand Down Expand Up @@ -137,7 +137,7 @@ describe("fs option", () => {
await engine.use(source, destination);

try {
await engine.build();
await engine.run();
assert.fail("An error should have been thrown");
}
catch (error) {
Expand Down Expand Up @@ -167,7 +167,7 @@ describe("fs option", () => {
await engine.use(source, destination);

try {
await engine.build();
await engine.run();
assert.fail("An error should have been thrown");
}
catch (error) {
Expand Down
12 changes: 6 additions & 6 deletions test/specs/process-file.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("Filesystem Destination plugin", () => {

let engine = new CodeEngine({ cwd });
await engine.use(source, destination);
await engine.build();
await engine.run();

// Make sure the output directory contains exactly what we expect
expect(cwd).to.have.deep.files([
Expand Down Expand Up @@ -68,7 +68,7 @@ describe("Filesystem Destination plugin", () => {

let engine = new CodeEngine({ cwd });
await engine.use(source, destination);
await engine.build();
await engine.run();

// Make sure the output directory contains exactly what we expect
expect(cwd).to.have.deep.files([
Expand Down Expand Up @@ -103,7 +103,7 @@ describe("Filesystem Destination plugin", () => {

let engine = new CodeEngine({ cwd });
await engine.use(source, destination);
await engine.build();
await engine.run();

// Make sure the output directory contains exactly what we expect
expect(cwd).to.have.deep.files([
Expand Down Expand Up @@ -138,7 +138,7 @@ describe("Filesystem Destination plugin", () => {

let engine = new CodeEngine({ cwd });
await engine.use(source, destination);
await engine.build();
await engine.run();

// Make sure the output directory contains exactly what we expect
expect(cwd).to.have.deep.files([
Expand Down Expand Up @@ -177,7 +177,7 @@ describe("Filesystem Destination plugin", () => {

let engine = new CodeEngine({ cwd });
await engine.use(source, destination);
await engine.build();
await engine.run();

let actualText = await fs.readFile(join(cwd, "dist/file"), "utf8");
expect(actualText).to.have.lengthOf(100 * MB);
Expand Down Expand Up @@ -208,7 +208,7 @@ describe("Filesystem Destination plugin", () => {

let engine = new CodeEngine({ cwd });
await engine.use(source, destination);
await engine.build();
await engine.run();

let actualBinary = await fs.readFile(join(cwd, "dist/file"));
expect(actualBinary).to.have.lengthOf(1 * GB);
Expand Down

0 comments on commit 860251e

Please sign in to comment.