Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Use babel-generator to regenerate enhanced assertion statements
Fixes #1513.
- Loading branch information
1 parent
3b81e2c
commit 37e8b49af78dc72bbf6a4ff674650cd57f48ea58
Showing
5 changed files
with
95 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
Some generated files are not rendered by default. Learn more.
Oops, something went wrong.
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
@@ -107,6 +107,7 @@ | ||
"auto-bind": "^1.1.0", | ||
"ava-init": "^0.2.0", | ||
"babel-core": "^6.17.0", | ||
"babel-generator": "^6.26.0", | ||
"bluebird": "^3.0.0", | ||
"caching-transform": "^1.0.0", | ||
"chalk": "^2.0.1", | ||
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
@@ -0,0 +1,21 @@ | ||
import test from '../..'; | ||
|
||
const foo = 'foo'; | ||
|
||
test('fails with multiple empty string expressions and mixed quotes', t => { | ||
// eslint-disable-next-line quotes, yoda | ||
t.true(foo === '' && "" === foo); | ||
}); | ||
|
||
test('fails with "instanceof" expression', t => { | ||
// eslint-disable-next-line no-new-object | ||
t.false(new Object(foo) instanceof Object); | ||
}); | ||
|
||
test('fails with multiple lines', t => { | ||
t.true( | ||
[foo].filter(item => { | ||
return item === 'bar'; | ||
}).length > 0 | ||
); | ||
}); |