Skip to content

Commit

Permalink
Merge pull request #122 from kubk/jest-tests-ci
Browse files Browse the repository at this point in the history
Fix Travis CI build, switch to Jest
  • Loading branch information
adamkleingit authored Feb 23, 2020
2 parents 68aa317 + cf87f62 commit c02122f
Show file tree
Hide file tree
Showing 9 changed files with 4,045 additions and 506 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ before_script:

script:
- npm run lint
- npm run test
- npm run build
- npm run test
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['./projects/mobx-angular/setup-tests.ts'],
globals: {
'ts-jest': {
tsConfig: './projects/mobx-angular/tsconfig.spec.json',
diagnostics: false
}
},
testRegex: '/.*\\.spec\\.ts$',
moduleFileExtensions: ['ts', 'js', 'node']
};
4,521 changes: 4,017 additions & 504 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"test": "jest",
"lint": "ng lint",
"e2e": "ng e2e"
},
Expand All @@ -21,6 +21,9 @@
"@angular/platform-browser": "~9.0.0",
"@angular/platform-browser-dynamic": "~9.0.0",
"@angular/router": "~9.0.0",
"@types/jest": "^25.1.3",
"jest": "^24.9.0",
"jest-preset-angular": "^8.0.0",
"mobx-remotedev": "^0.3.6",
"rxjs": "~6.5.4",
"todomvc-app-css": "^2.3.0",
Expand Down
3 changes: 3 additions & 0 deletions projects/bank/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./tsconfig.app.json"
}
1 change: 1 addition & 0 deletions projects/mobx-angular/setup-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'jest-preset-angular';
1 change: 1 addition & 0 deletions projects/mobx-angular/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": "../../out-tsc/spec",
"types": ["jasmine", "node"]
},
Expand Down
3 changes: 3 additions & 0 deletions projects/tictactoe/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./tsconfig.app.json"
}
3 changes: 3 additions & 0 deletions projects/todo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./tsconfig.app.json"
}

0 comments on commit c02122f

Please sign in to comment.