Skip to content

Commit

Permalink
ESLint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMessinger committed Jul 18, 2020
1 parent 399c677 commit 4eb16fa
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@

root: true
extends: "@jsdevtools"
env:
node: true
4 changes: 2 additions & 2 deletions test/specs/cli.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("simplifyify --help", () => {

it("should exit with zero if called with --help", (done) => {
cli.run("--help", (err) => {
expect(err).to.be.null;
expect(err).to.equal(null);
done();
});
});
Expand All @@ -48,7 +48,7 @@ describe("simplifyify --help", () => {

it("should exit with zero if called with -h", (done) => {
cli.run("--help", (err) => {
expect(err).to.be.null;
expect(err).to.equal(null);
done();
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/specs/debug.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ describe("simplifyify --debug", () => {
]);

assert.fileContents("es5/dist", ["index.bundle.es", "hello-world.bundle.es", "say/index.bundle.es"],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasPreamble(contents);
assert.notMinified(contents);
assert.hasSourceMap(contents);
assert.noCoverage(contents);
});
assert.fileContents("es5/dist", ["index.bundle.min.es", "hello-world.bundle.min.es", "say/index.bundle.min.es"],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasMinifiedPreamble(contents);
assert.isMinified(contents);
Expand Down
2 changes: 1 addition & 1 deletion test/specs/minify.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ describe("simplifyify --minify", () => {
assert.noCoverage(contents);
});
assert.fileContents("es5/dist", ["index.foo.min.es5", "hello-world.foo.min.es5", "say/index.foo.min.es5"],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasMinifiedPreamble(contents);
assert.isMinified(contents);
Expand Down
12 changes: 6 additions & 6 deletions test/specs/outfile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe("simplifyify --outfile", () => {
assert.fileContents("es5/lib", [
"index.bundle.js", "hello-world.bundle.js", "say/index.bundle.js"
],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasPreamble(contents);
assert.notMinified(contents);
Expand All @@ -181,7 +181,7 @@ describe("simplifyify --outfile", () => {
assert.fileContents("es5/lib", [
"index.bundle.min.js", "hello-world.bundle.min.js", "say/index.bundle.min.js"
],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasMinifiedPreamble(contents);
assert.isMinified(contents);
Expand All @@ -192,7 +192,7 @@ describe("simplifyify --outfile", () => {
assert.fileContents("es5/lib", [
"index.bundle.coverage.js", "hello-world.bundle.coverage.js", "say/index.bundle.coverage.js"
],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasMinifiedPreamble(contents);
assert.isMinified(contents, true);
Expand All @@ -202,7 +202,7 @@ describe("simplifyify --outfile", () => {
);

assert.fileContents("es5/lib", ["index.bundle.js.map", "index.bundle.min.js.map"],
function (contents) {
(contents) => {
expect(contents.sources).to.contain.members([
"hello-world.js",
"index.js",
Expand All @@ -211,15 +211,15 @@ describe("simplifyify --outfile", () => {
}
);
assert.fileContents("es5/lib", ["hello-world.bundle.js.map", "hello-world.bundle.min.js.map"],
function (contents) {
(contents) => {
expect(contents.sources).to.contain.members([
"hello-world.js",
"say/index.js"
]);
}
);
assert.fileContents("es5/lib", ["say/index.bundle.js.map", "say/index.bundle.min.js.map"],
function (contents) {
(contents) => {
expect(contents.sources).to.contain.members([
"index.js"
]);
Expand Down
4 changes: 2 additions & 2 deletions test/specs/test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ describe("simplifyify --coverage", () => {
assert.noCoverage(contents);
});
assert.fileContents("es5/dist", ["index.foo.min.es5", "hello-world.foo.min.es5", "say/index.foo.min.es5"],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasMinifiedPreamble(contents);
assert.isMinified(contents);
assert.hasSourceMap(contents);
assert.noCoverage(contents);
});
assert.fileContents("es5/dist", ["index.foo.coverage.es5", "hello-world.foo.coverage.es5", "say/index.foo.coverage.es5"],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasMinifiedPreamble(contents);
assert.isMinified(contents, true);
Expand Down
12 changes: 6 additions & 6 deletions test/specs/watch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("simplifyify --watch", () => {
originalFileContents = undefined;
});

afterEach(function () {
afterEach(() => {
if (modifiedFilePath) {
// Restore the original contents of the file that was modified to trigger Watchify
return util.writeFile(modifiedFilePath, originalFileContents);
Expand Down Expand Up @@ -122,7 +122,7 @@ describe("simplifyify --watch", () => {
function onExit (err, stdout, stderr) {
try {
// Verify the final results
expect(stderr).to.be.empty;
expect(stderr).to.have.lengthOf(0);
expect(stdout).to.contain("es5/lib/index.js --> es5/dist/my-file.js");
expect(stdout).to.contain("\nes5/lib/say/index.js has changed");
done();
Expand Down Expand Up @@ -223,23 +223,23 @@ describe("simplifyify --watch", () => {
]);

assert.fileContents("es5/dist", ["index.bundle.js", "hello-world.bundle.js", "say/index.bundle.js"],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasUmdPreamble(contents);
assert.notMinified(contents);
assert.hasSourceMap(contents);
assert.noCoverage(contents);
});
assert.fileContents("es5/dist", ["index.bundle.min.js", "hello-world.bundle.min.js", "say/index.bundle.min.js"],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasMinifiedUmdPreamble(contents);
assert.isMinified(contents);
assert.hasSourceMap(contents);
assert.noCoverage(contents);
});
assert.fileContents("es5/dist", ["index.bundle.coverage.js", "hello-world.bundle.coverage.js", "say/index.bundle.coverage.js"],
function (contents) {
(contents) => {
assert.noBanner(contents);
assert.hasMinifiedUmdPreamble(contents);
assert.isMinified(contents, true);
Expand Down Expand Up @@ -270,7 +270,7 @@ describe("simplifyify --watch", () => {
// Verify the final results
function onExit (err, stdout, stderr) {
try {
expect(stderr).to.be.empty;
expect(stderr).to.have.lengthOf(0);

expect(stdout).to.contain("es5/lib/index.js --> es5/dist/index.bundle.js");
expect(stdout).to.contain("es5/lib/index.js --> es5/dist/index.bundle.js.map");
Expand Down

0 comments on commit 4eb16fa

Please sign in to comment.