Skip to content

Commit a0b6f37

Browse files
author
arensman
committed
Add tests for affected rules
1 parent 1728b69 commit a0b6f37

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

tests/lib/rules/no-arrow-tests.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,26 @@ ruleTester.run("no-arrow-tests", rule, {
190190
},
191191
],
192192
},
193+
{
194+
code: "QUnit.module('module', { before: () => {} });",
195+
output: "QUnit.module('module', { before: function() {} });",
196+
errors: [
197+
{
198+
messageId: "noArrowFunction",
199+
type: "ArrowFunctionExpression",
200+
},
201+
],
202+
},
203+
{
204+
code: "QUnit.module('module', { after: () => {} });",
205+
output: "QUnit.module('module', { after: function() {} });",
206+
errors: [
207+
{
208+
messageId: "noArrowFunction",
209+
type: "ArrowFunctionExpression",
210+
},
211+
],
212+
},
193213
{
194214
code: "module('module', { setup: () => {} });",
195215
output: "module('module', { setup: function() {} });",

tests/lib/rules/no-qunit-start-in-tests.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ ruleTester.run("no-qunit-start-in-tests", rule, {
5353
code: 'QUnit.module("module", { afterEach: function() { QUnit.start(); } });',
5454
errors: [createError("afterEach hook")],
5555
},
56+
{
57+
code: 'QUnit.module("module", { before: function() { QUnit.start(); } });',
58+
errors: [createError("before hook")],
59+
},
60+
{
61+
code: 'QUnit.module("module", { after: function() { QUnit.start(); } });',
62+
errors: [createError("after hook")],
63+
},
5664
{
5765
code: 'QUnit.module("module", { setup: function() { QUnit.start(); } });',
5866
errors: [createError("setup hook")],

tests/lib/rules/no-setup-teardown.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ ruleTester.run("no-setup-teardown", rule, {
2929
// afterEach
3030
"QUnit.module('Module', { afterEach: function () {} });",
3131

32+
// before
33+
"QUnit.module('Module', { before: function () {} });",
34+
35+
// after
36+
"QUnit.module('Module', { after: function () {} });",
37+
3238
// both
3339
"QUnit.module('Module', { beforeEach: function () {}, afterEach: function () {} });",
3440

tests/lib/rules/resolve-async.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ ruleTester.run("resolve-async", rule, {
185185
code: "QUnit.module('name', { teardown: function () { QUnit.stop(); } });",
186186
errors: [createNeedStartCallsMessage("Property")],
187187
},
188+
{
189+
code: "QUnit.module('name', { before: function () { QUnit.stop(); } });",
190+
errors: [createNeedStartCallsMessage("Property")],
191+
},
188192
{
189193
code: "QUnit.module('name', { beforeEach: function () { QUnit.stop(); } });",
190194
errors: [createNeedStartCallsMessage("Property")],
@@ -193,6 +197,10 @@ ruleTester.run("resolve-async", rule, {
193197
code: "QUnit.module('name', { afterEach: function () { QUnit.stop(); } });",
194198
errors: [createNeedStartCallsMessage("Property")],
195199
},
200+
{
201+
code: "QUnit.module('name', { after: function () { QUnit.stop(); } });",
202+
errors: [createNeedStartCallsMessage("Property")],
203+
},
196204

197205
// Multiple start() calls needed
198206
{

0 commit comments

Comments
 (0)