Skip to content

Commit

Permalink
feat: jest 24
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Jan 26, 2019
1 parent 801cb62 commit e4966f7
Show file tree
Hide file tree
Showing 6 changed files with 2,087 additions and 1,965 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
InlineHtmlStripStylesTransformer.js
InlineHtmlStripStylesTransformer.js
*.log
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import './jestGlobalMocks'; // browser mocks globally available for every test
{
"jest": {
"preset": "jest-preset-angular",
"setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts"
"setupFilesAfterEnv": ["<rootDir>/src/setupJest.ts"]
}
}
```
Expand Down Expand Up @@ -81,7 +81,7 @@ import './jestGlobalMocks'; // browser mocks globally available for every test
* `"testMatch"` – we want to run Jest on files that matches this glob
* `"moduleFileExtensions"` – our modules are TypeScript and JavaScript files
* `"moduleNameMapper"` – if you're using absolute imports here's how to tell Jest where to look for them; uses regex
* `"setupTestFrameworkScriptFile"` – this is the heart of our config, in this file we'll setup and patch environment within tests are running
* `"setupFilesAfterEnv"` – this is the heart of our config, in this file we'll setup and patch environment within tests are running
* `"transformIgnorePatterns"` – unfortunately some modules (like @ngrx ) are released as TypeScript files, not pure JavaScript; in such cases we cannot ignore them (all node_modules are ignored by default), so they can be transformed through TS compiler like any other module in our project.

## [AST Transformer](https://github.com/thymikee/jest-preset-angular/blob/master/src/InlineHtmlStripStylesTransformer.ts)
Expand Down
6 changes: 4 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@angular/compiler-cli": "6.1.2",
"@types/node": "^10.5.8",
"codelyzer": "^4.4.3",
"jest": "^23.5.0",
"jest": "^24.0.0",
"jest-preset-angular": "file:../",
"protractor": "^5.4.0",
"ts-node": "^7.0.1",
Expand All @@ -47,6 +47,8 @@
"\\.(jpg|jpeg|png)$": "<rootDir>/__mocks__/image.js",
"^@lib/(.*)$": "<rootDir>/src/lib/$1"
},
"setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts"
"setupFilesAfterEnv": [
"<rootDir>/src/setupJest.ts"
]
}
}
Loading

0 comments on commit e4966f7

Please sign in to comment.