Skip to content

Commit 5ae97ce

Browse files
committed
chore(cypress): replace deprecated library
1 parent 271401b commit 5ae97ce

File tree

8 files changed

+101
-1795
lines changed

8 files changed

+101
-1795
lines changed

angular.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@
8787
"defaultConfiguration": "development"
8888
},
8989
"serve-coverage": {
90-
"builder": "ngx-build-plus:dev-server",
90+
"builder": "@angular-builders/custom-webpack:dev-server",
9191
"options": {
92-
"browserTarget": "trackify:build",
93-
"extraWebpackConfig": "./cypress/coverage.webpack.js"
92+
"browserTarget": "ng-base-project:build:e2e"
9493
}
9594
},
9695
"extract-i18n": {
@@ -146,7 +145,7 @@
146145
},
147146
"configurations": {
148147
"production": {
149-
"devServerTarget": "nebula-audit-console:serve-coverage:production"
148+
"devServerTarget": "trackify:serve-coverage:production"
150149
}
151150
}
152151
}

cypress/coverage.webpack.js cypress/coverage.webpack.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
module.exports = {
1+
import * as path from 'path';
2+
3+
export default {
24
module: {
35
rules: [
46
{
57
test: /\.(js|ts)$/,
6-
loader: 'istanbul-instrumenter-loader',
8+
loader: '@jsdevtools/coverage-istanbul-loader',
79
options: { esModules: true },
810
enforce: 'post',
9-
include: require('path').join(__dirname, '..', 'src'),
11+
include: path.join(__dirname, '..', 'src'),
1012
exclude: [/\.(e2e|spec)\.ts$/, /node_modules/, /(ngfactory|ngstyle)\.js/],
1113
},
1214
],

cypress/integration/spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe('My First Test', () => {
22
it('Visits the initial project page', () => {
3-
cy.visit('/')
4-
cy.contains('Welcome')
5-
cy.contains('sandbox app is running!')
6-
})
7-
})
3+
cy.visit('/');
4+
cy.contains('Welcome');
5+
cy.contains('sandbox app is running!');
6+
});
7+
});

cypress/plugins/cy-ts-preprocessor.js

-27
This file was deleted.

cypress/plugins/index.ts

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
const cypressTypeScriptPreprocessor = require('./cy-ts-preprocessor');
2-
3-
module.exports = (on: any, config: any) => {
4-
on('file:preprocessor', cypressTypeScriptPreprocessor);
5-
6-
require('@cypress/code-coverage/task')(on, config);
7-
8-
return config;
1+
export default (on: any, config: any) => {
2+
return require('@cypress/code-coverage/task')(on, config);
93
};
10-

cypress/support/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ import './commands';
1818

1919
// Import cypress code-coverage collector plugin
2020
import '@cypress/code-coverage/support';
21-

0 commit comments

Comments
 (0)