|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
719 bytes
|
| Line | |
|---|
| 1 | # Disallow importing Jest (`no-jest-import`)
|
|---|
| 2 |
|
|---|
| 3 | The `jest` object is automatically in scope within every test file. The methods
|
|---|
| 4 | in the `jest` object help create mocks and let you control Jest's overall
|
|---|
| 5 | behavior. It is therefore completely unnecessary to import in `jest`, as Jest
|
|---|
| 6 | doesn't export anything in the first place.
|
|---|
| 7 |
|
|---|
| 8 | ### Rule details
|
|---|
| 9 |
|
|---|
| 10 | This rule reports on any importing of Jest.
|
|---|
| 11 |
|
|---|
| 12 | To name a few: `var jest = require('jest');` `const jest = require('jest');`
|
|---|
| 13 | `import jest from 'jest';` `import {jest as test} from 'jest';`
|
|---|
| 14 |
|
|---|
| 15 | There is no correct usage of this code, other than to not import `jest` in the
|
|---|
| 16 | first place.
|
|---|
| 17 |
|
|---|
| 18 | ## Further Reading
|
|---|
| 19 |
|
|---|
| 20 | \*[The Jest Object](https://facebook.github.io/jest/docs/en/jest-object.html)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.