-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed name of test and added more tests with other requested changes.
- Loading branch information
Showing
6 changed files
with
43 additions
and
39 deletions.
There are no files selected for viewing
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import test from 'ava'; | ||
import avaRuleTester from 'eslint-ava-rule-tester'; | ||
import rule from '../rules/no-typeerror-with-notthrows'; | ||
|
||
const ruleTester = avaRuleTester(test, { | ||
env: { | ||
es6: true | ||
} | ||
}); | ||
|
||
const errors = [{ruleId: 'no-typerror-with-notthrows'}]; | ||
|
||
const header = `const test = require('ava');\n`; // eslint-disable-line quotes | ||
|
||
ruleTester.run('no-typeerror-with-notthrows', rule, { | ||
valid: [ | ||
`${header} test('some test',t => {t.notThrows(() => {t.pass();});});`, | ||
`${header} test(t => {t.notThrows(() => {t.pass();});});`, | ||
`${header} test(t => {t.throws(() => {t.pass();}, TypeError);});`, | ||
`${header} test(t => {t.end(); })`, | ||
`${header} test('some test',t => {t.notThrows(() => {t.pass();}, true);});`, | ||
`${header} test('some test',t => {t.notThrows(() => {t.pass();}, 'some string');});`, | ||
`${header} test('some test',t => {t.notThrows(() => {t.pass();}, {firstName:'some', lastName: 'object'});});` | ||
], | ||
invalid: [ | ||
{ | ||
code: `${header} test(t => {t.notThrows(() => {t.pass();}, TypeError);});`, | ||
errors | ||
}, | ||
{ | ||
code: `${header} test('some test',t => {t.notThrows(() => {t.pass();}, TypeError);});`, | ||
errors | ||
} | ||
] | ||
}); |
This file was deleted.
Oops, something went wrong.