Skip to content

Commit

Permalink
chore(example): update jest dependencies and configuration (#1680)
Browse files Browse the repository at this point in the history
Closes #1674
  • Loading branch information
timdeschryver authored and brandonroberts committed Apr 1, 2019
1 parent 7f42917 commit 24711ca
Show file tree
Hide file tree
Showing 12 changed files with 1,433 additions and 724 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
- checkout
- restore_cache:
key: *cache_key
- run: yarn run example:test --watch=false
- run: yarn run example:test --watch=false --runInBand

example-e2e-tests:
<<: *run_in_browser
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"@types/globby": "^8.0.0",
"@types/jasmine": "2.5.45",
"@types/jasminewd2": "^2.0.2",
"@types/jest": "^20.0.2",
"@types/jest": "^24.0.11",
"@types/lodash": "^4.14.80",
"@types/ncp": "^2.0.1",
"@types/node": "^7.0.5",
Expand All @@ -134,9 +134,9 @@
"jasmine-core": "~2.5.2",
"jasmine-marbles": "^0.4.0",
"jasmine-spec-reporter": "~3.2.0",
"jest": "^21.0.2",
"jest-preset-angular": "^3.0.1",
"jest-zone-patch": "^0.0.7",
"jest": "^24.5.0",
"jest-preset-angular": "^7.0.1",
"jest-zone-patch": "^0.0.10",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
Expand Down
21 changes: 14 additions & 7 deletions projects/example-app/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
module.exports = {
rootDir: '.',
setupTestFrameworkScriptFile: '<rootDir>/src/setup-jest.ts',
setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
globals: {
'ts-jest': {
tsConfigFile: 'projects/example-app/tsconfig.spec.json',
tsConfig: 'projects/example-app/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html?$',
astTransformers: [
require.resolve('jest-preset-angular/InlineHtmlStripStylesTransformer'),
],
},
__TRANSFORM_HTML__: true,
},
transform: {
'^.+\\.(ts|js|html)$':
'<rootDir>/../../node_modules/jest-preset-angular/preprocessor.js',
'^.+\\.(ts|js|html)$': 'ts-jest',
},
testMatch: ['<rootDir>/**/*.spec.ts'],
moduleFileExtensions: ['ts', 'js', 'html', 'json'],
mapCoverage: true,
testEnvironment: 'jest-environment-jsdom-thirteen',
moduleFileExtensions: ['html', 'js', 'json', 'ts'],
coveragePathIgnorePatterns: ['/node_modules/', '/modules/*.*/'],
moduleNameMapper: {
'^@ngrx/(.*)': '<rootDir>/../../modules/$1',
'^@example-app/(.*)': '<rootDir>/src/app/$1',
},
transformIgnorePatterns: ['node_modules/(?!@ngrx)'],
modulePathIgnorePatterns: ['dist'],
preset: 'jest-preset-angular',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,19 @@ exports[`Login Page should compile 1`] = `
form={[Function FormGroup]}
submitted={[Function EventEmitter]}
>
<mat-card
_ngcontent-c0=""
>
<mat-card-title
_ngcontent-c0=""
>
<mat-card>
<mat-card-title>
Login
</mat-card-title>
<mat-card-content
_ngcontent-c0=""
>
<mat-card-content>
<form
_ngcontent-c0=""
class="ng-untouched ng-pristine ng-valid"
ng-reflect-form="[object Object]"
novalidate=""
>
<p
_ngcontent-c0=""
>
<mat-form-field
_ngcontent-c0=""
>
<p>
<mat-form-field>
<input
_ngcontent-c0=""
class="ng-untouched ng-pristine ng-valid"
formcontrolname="username"
matinput=""
Expand All @@ -39,14 +27,9 @@ exports[`Login Page should compile 1`] = `
/>
</mat-form-field>
</p>
<p
_ngcontent-c0=""
>
<mat-form-field
_ngcontent-c0=""
>
<p>
<mat-form-field>
<input
_ngcontent-c0=""
class="ng-untouched ng-pristine ng-valid"
formcontrolname="password"
matinput=""
Expand All @@ -58,11 +41,9 @@ exports[`Login Page should compile 1`] = `
</p>
<p
_ngcontent-c0=""
class="loginButtons"
>
<button
_ngcontent-c0=""
mat-button=""
type="submit"
>
Expand All @@ -80,31 +61,19 @@ exports[`Login Page should disable the form if pending 1`] = `
form={[Function FormGroup]}
submitted={[Function EventEmitter]}
>
<mat-card
_ngcontent-c1=""
>
<mat-card-title
_ngcontent-c1=""
>
<mat-card>
<mat-card-title>
Login
</mat-card-title>
<mat-card-content
_ngcontent-c1=""
>
<mat-card-content>
<form
_ngcontent-c1=""
class="ng-untouched ng-pristine"
ng-reflect-form="[object Object]"
novalidate=""
>
<p
_ngcontent-c1=""
>
<mat-form-field
_ngcontent-c1=""
>
<p>
<mat-form-field>
<input
_ngcontent-c1=""
class="ng-untouched ng-pristine"
disabled=""
formcontrolname="username"
Expand All @@ -115,14 +84,9 @@ exports[`Login Page should disable the form if pending 1`] = `
/>
</mat-form-field>
</p>
<p
_ngcontent-c1=""
>
<mat-form-field
_ngcontent-c1=""
>
<p>
<mat-form-field>
<input
_ngcontent-c1=""
class="ng-untouched ng-pristine"
disabled=""
formcontrolname="password"
Expand All @@ -135,11 +99,9 @@ exports[`Login Page should disable the form if pending 1`] = `
</p>
<p
_ngcontent-c1=""
class="loginButtons"
>
<button
_ngcontent-c1=""
mat-button=""
type="submit"
>
Expand All @@ -158,31 +120,19 @@ exports[`Login Page should display an error message if provided 1`] = `
form={[Function FormGroup]}
submitted={[Function EventEmitter]}
>
<mat-card
_ngcontent-c2=""
>
<mat-card-title
_ngcontent-c2=""
>
<mat-card>
<mat-card-title>
Login
</mat-card-title>
<mat-card-content
_ngcontent-c2=""
>
<mat-card-content>
<form
_ngcontent-c2=""
class="ng-untouched ng-pristine ng-valid"
ng-reflect-form="[object Object]"
novalidate=""
>
<p
_ngcontent-c2=""
>
<mat-form-field
_ngcontent-c2=""
>
<p>
<mat-form-field>
<input
_ngcontent-c2=""
class="ng-untouched ng-pristine ng-valid"
formcontrolname="username"
matinput=""
Expand All @@ -192,14 +142,9 @@ exports[`Login Page should display an error message if provided 1`] = `
/>
</mat-form-field>
</p>
<p
_ngcontent-c2=""
>
<mat-form-field
_ngcontent-c2=""
>
<p>
<mat-form-field>
<input
_ngcontent-c2=""
class="ng-untouched ng-pristine ng-valid"
formcontrolname="password"
matinput=""
Expand All @@ -211,17 +156,14 @@ exports[`Login Page should display an error message if provided 1`] = `
</p>
<p
_ngcontent-c2=""
class="loginError"
>
Invalid credentials
</p>
<p
_ngcontent-c2=""
class="loginButtons"
>
<button
_ngcontent-c2=""
mat-button=""
type="submit"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@
exports[`Logout Confirmation Dialog should compile 1`] = `
<ng-component>
<h2
_ngcontent-c0=""
class="mat-dialog-title"
id="mat-dialog-title-0"
mat-dialog-title=""
>
Logout
</h2><mat-dialog-content
_ngcontent-c0=""
class="mat-dialog-content"
>
Are you sure you want to logout?
</mat-dialog-content><mat-dialog-actions
_ngcontent-c0=""
class="mat-dialog-actions"
>
<button
_ngcontent-c0=""
aria-label="Close dialog"
class="mat-button"
mat-button=""
Expand All @@ -43,7 +39,6 @@ exports[`Logout Confirmation Dialog should compile 1`] = `
/>
</button>
<button
_ngcontent-c0=""
aria-label="Close dialog"
class="mat-button"
mat-button=""
Expand Down
Loading

0 comments on commit 24711ca

Please sign in to comment.