Skip to content

Commit

Permalink
update(web-testing): jest expect DOM extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Aug 4, 2021
1 parent f5484c0 commit 1cc94f9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions notes/web/javascript/javascriptAdvancedNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7430,6 +7430,7 @@ module.exports = {
testURL: 'http://localhost',
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/jest.setup.js'],
setupFilesAfterEnv: ['<rootDir>/jest.env.setup.js'],
setupTestFrameworkScriptFile: '<rootDir>/src/setupEnzyme.ts',
};
```
Expand Down Expand Up @@ -7460,6 +7461,12 @@ window.localStorage = {
Object.values = () => [];
```
`jest.env.setup.js`: inject more expect DOM assertion
```js
import '@testing-library/jest-dom/extend-expect';
```
`setupEnzyme.ts`:
```ts
Expand Down

0 comments on commit 1cc94f9

Please sign in to comment.