-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge branch 'main' into jsdoc-39.9.1
- Loading branch information
Showing
5 changed files
with
59 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,46 @@ | ||
QUnit.module( 'Example' ); | ||
QUnit.module( 'Module', ( hooks ) => { | ||
|
||
// Off: qunit/no-arrow-tests | ||
// Valid: qunit/require-expect | ||
QUnit.test( '.foo()', () => { | ||
} ); | ||
hooks.beforeEach( ( assert ) => { | ||
assert.ok( true, 'beforeEach' ); | ||
} ); | ||
|
||
// Off: qunit/no-arrow-tests | ||
// Valid: qunit/require-expect | ||
QUnit.test( '.foo()', () => { | ||
} ); | ||
|
||
QUnit.test( '.bar()', function ( assert ) { | ||
const x = 'bar', | ||
y = 'baz'; | ||
|
||
// The following rules are superseded by qunit/no-loose-assertions, | ||
// so are turned off to avoid double errors. | ||
// Off: qunit/no-assert-equal | ||
// Off: qunit/no-negated-ok | ||
// Off: qunit/no-ok-equality | ||
|
||
QUnit.test( '.bar()', function ( assert ) { | ||
const x = 'bar', | ||
y = 'baz'; | ||
// Valid: qunit/no-assert-equal | ||
assert.strictEqual( x, 'bar' ); | ||
|
||
// The following rules are superseded by qunit/no-loose-assertions, | ||
// so are turned off to avoid double errors. | ||
// Off: qunit/no-assert-equal | ||
// Off: qunit/no-negated-ok | ||
// Off: qunit/no-ok-equality | ||
// Off: qunit/no-assert-equal-boolean | ||
assert.strictEqual( x, true ); | ||
|
||
// Valid: qunit/no-assert-equal | ||
assert.strictEqual( x, 'bar' ); | ||
// Valid: qunit/no-negated-ok | ||
if ( x ) { | ||
// Off: qunit/no-conditional-assertions | ||
assert.true( x ); | ||
} | ||
|
||
// Off: qunit/no-assert-equal-boolean | ||
assert.strictEqual( x, true ); | ||
// Off: qunit/no-assert-logical-expression | ||
assert.true( x && y ); | ||
} ); | ||
|
||
// Valid: qunit/no-negated-ok | ||
if ( x ) { | ||
// Off: qunit/no-conditional-assertions | ||
assert.true( x ); | ||
} | ||
// Valid: no-shadow | ||
// The variable name "hooks" can be shadowed (#532) | ||
QUnit.module( 'Nested module', ( hooks ) => { | ||
hooks.beforeEach( ( assert ) => { | ||
assert.ok( true, 'nested beforeEach' ); | ||
} ); | ||
} ); | ||
|
||
// Off: qunit/no-assert-logical-expression | ||
assert.true( x && y ); | ||
} ); |