-
Notifications
You must be signed in to change notification settings - Fork 21
/
no-only.js
36 lines (29 loc) · 973 Bytes
/
no-only.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* @fileoverview Forbid the use of QUnit.only.
* @author Kevin Partington
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
var rule = require("../../../lib/rules/no-only"),
RuleTester = require("eslint").RuleTester;
//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------
var ruleTester = new RuleTester();
ruleTester.run("no-only", rule, {
valid: [
"QUnit.test('Name', function() { });",
// QUnit.only is not exposed globally so this is valid
"only('Name', function() { });"
],
invalid: [
{
code: "QUnit.only('Name', function() { });",
errors: [
"Unexpected QUnit.only call."
]
}
]
});