Skip to content

Commit 103e1de

Browse files
Added .spec.js extension to test files
1 parent 7b0f972 commit 103e1de

13 files changed

+17
-23
lines changed

test/mocha.opts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
--bail
22
test/fixtures/*.js
3-
test/specs/*.js
3+
test/specs/*.spec.js

test/specs/best-practices.js renamed to test/specs/best-practices.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ describe("best-practices", function () {
2424
});
2525

2626
it('should require the "use strict" pragma at the global level for CommonJS', function () {
27-
let results = ESLint.run(["modular/best-practices", "modular/common-js"], "function foo () {} foo();");
27+
let results = ESLint.run(["modular/best-practices", "modular/modules/cjs"], "function foo () {} foo();");
2828
results.errorCount.should.equal(1);
2929
results.rules.should.deep.equal(["strict"]);
3030
results.messages[0].message.should.equal("Use the global form of 'use strict'.");
3131
});
3232
});
33-

test/specs/browser.js renamed to test/specs/browser.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("browser", function () {
2424
});
2525

2626
it('should require the "use strict" pragma at the global level if the CommonJS module is loaded after', function () {
27-
let results = ESLint.run(["modular/browser", "modular/common-js"], "function foo () {} foo();");
27+
let results = ESLint.run(["modular/browser", "modular/modules/cjs"], "function foo () {} foo();");
2828
results.errorCount.should.equal(1);
2929
results.rules.should.deep.equal(["strict"]);
3030
results.messages[0].message.should.equal("Use the global form of 'use strict'.");

test/specs/common-js.js renamed to test/specs/common-js.spec.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@ const ESLint = require("../fixtures/eslint");
44
const chai = require("chai");
55
chai.should();
66

7-
describe("common-js", function () {
7+
describe("modules/cjs", function () {
88
it("should not be enforced if module is not used", function () {
99
let results = ESLint.run("modular/style", "foo(); function foo () {}\n");
1010
results.errorCount.should.equal(0);
1111
});
1212

1313
it('should require the "use strict" pragma at the global level', function () {
14-
let results = ESLint.run("modular/common-js", "function foo () {} foo();");
14+
let results = ESLint.run("modular/modules/cjs", "function foo () {} foo();");
1515
results.errorCount.should.equal(1);
1616
results.rules.should.deep.equal(["strict"]);
1717
results.messages[0].message.should.equal("Use the global form of 'use strict'.");
1818
});
1919

2020
it("should not allow ES6 module syntax", function () {
21-
let results = ESLint.run("modular/common-js", "import foo from 'bar';");
21+
let results = ESLint.run("modular/modules/cjs", "import foo from 'bar';");
2222
results.errorCount.should.equal(1);
2323
results.messages.should.have.lengthOf(1);
2424
results.messages[0].message.should.equal("Parsing error: The keyword 'import' is reserved");
2525
});
2626
});
27-
File renamed without changes.

test/specs/es6-modules.js renamed to test/specs/es6-modules.spec.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const ESLint = require("../fixtures/eslint");
44
const chai = require("chai");
55
chai.should();
66

7-
describe("es6-modules", function () {
7+
describe("modules/esm", function () {
88
it("should not be enforced if module is not used", function () {
99
let results = ESLint.run("modular/es6",
1010
"const foo = 5;\n" +
@@ -14,28 +14,27 @@ describe("es6-modules", function () {
1414
});
1515

1616
it('should not allow the "use strict" pragma', function () {
17-
let results = ESLint.run("modular/es6-modules", '"use strict";');
17+
let results = ESLint.run("modular/modules/esm", '"use strict";');
1818
results.errorCount.should.equal(1);
1919
results.rules.should.deep.equal(["strict"]);
2020
results.messages[0].message.should.equal("'use strict' is unnecessary inside of modules.");
2121
});
2222

2323
it("should allow ES6 module syntax", function () {
2424
let results = ESLint.run(
25-
["modular/es6", "modular/es6-modules"],
25+
["modular/es6", "modular/modules/esm"],
2626
"import foo from 'bar';"
2727
);
2828
results.errorCount.should.equal(0);
2929
});
3030

31-
it('should not allow ES6 module syntax if followed by the "common-js" module', function () {
31+
it('should not allow ES6 module syntax if followed by the "modules/cjs" module', function () {
3232
let results = ESLint.run(
33-
["modular/es6", "modular/es6-modules", "modular/common-js"],
33+
["modular/es6", "modular/modules/esm", "modular/modules/cjs"],
3434
"import foo from 'bar';"
3535
);
3636
results.errorCount.should.equal(1);
3737
results.messages.should.have.lengthOf(1);
3838
results.messages[0].message.should.equal("Parsing error: 'import' and 'export' may appear only with 'sourceType: module'");
3939
});
4040
});
41-

test/specs/es6.js renamed to test/specs/es6.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("es6", function () {
1313
results.errorCount.should.equal(0);
1414
});
1515

16-
it('should not allow ES6 module syntax unless the "es6-modules" module is also used', function () {
16+
it('should not allow ES6 module syntax unless the "modules/esm" module is also used', function () {
1717
let results = ESLint.run("modular/es6", "import foo from 'bar';");
1818
results.errorCount.should.equal(1);
1919
results.messages.should.have.lengthOf(1);
@@ -36,4 +36,3 @@ describe("es6", function () {
3636
results.rules.should.deep.equal(["object-shorthand"]);
3737
});
3838
});
39-
File renamed without changes.
File renamed without changes.

test/specs/jsx.js renamed to test/specs/jsx.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ describe("jsx", function () {
1414
});
1515

1616
it("should require double quotes for JSX attributes", function () {
17-
let results = ESLint.run(["modular/es6", "modular/jsx"],
17+
let results = ESLint.run(["modular/es6", "modular/browser/jsx"],
1818
"let foo = <div className='some-class'>hello, world</div>;"
1919
);
2020
results.errorCount.should.equal(1);
2121
results.rules.should.deep.equal(["jsx-quotes"]);
2222
});
2323
});
24-

0 commit comments

Comments
 (0)