Skip to content

Commit c70d5dc

Browse files
authored
Merge pull request #3287 from numbersprotocol/fix-npm-warnings
fix(package.json): resolve npm warnings
2 parents 5b7862e + bc82660 commit c70d5dc

15 files changed

+2714
-7211
lines changed

angular.json

+29-22
Original file line numberDiff line numberDiff line change
@@ -144,44 +144,47 @@
144144
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
145145
}
146146
},
147-
"e2e": {
148-
"builder": "@angular-devkit/build-angular:protractor",
147+
"cypress-run": {
148+
"builder": "@cypress/schematic:cypress",
149149
"options": {
150-
"protractorConfig": "e2e/protractor.conf.js"
150+
"devServerTarget": "app:serve"
151151
},
152152
"configurations": {
153153
"production": {
154154
"devServerTarget": "app:serve:production"
155-
},
156-
"ci": {
157-
"devServerTarget": "app:serve:ci"
158-
},
159-
"development": {
160-
"devServerTarget": "app:serve:development"
161155
}
162-
},
163-
"defaultConfiguration": "development"
156+
}
164157
},
165-
"ionic-cordova-build": {
166-
"builder": "@ionic/angular-toolkit:cordova-build",
158+
"cypress-open": {
159+
"builder": "@cypress/schematic:cypress",
167160
"options": {
168-
"browserTarget": "app:build"
161+
"watch": true,
162+
"headless": false
163+
}
164+
},
165+
"ct": {
166+
"builder": "@cypress/schematic:cypress",
167+
"options": {
168+
"devServerTarget": "app:serve",
169+
"watch": true,
170+
"headless": false,
171+
"testingType": "component"
169172
},
170173
"configurations": {
171-
"production": {
172-
"browserTarget": "app:build:production"
174+
"development": {
175+
"devServerTarget": "app:serve:development"
173176
}
174177
}
175178
},
176-
"ionic-cordova-serve": {
177-
"builder": "@ionic/angular-toolkit:cordova-serve",
179+
"e2e": {
180+
"builder": "@cypress/schematic:cypress",
178181
"options": {
179-
"cordovaBuildTarget": "app:ionic-cordova-build",
180-
"devServerTarget": "app:serve"
182+
"devServerTarget": "app:serve",
183+
"watch": true,
184+
"headless": false
181185
},
182186
"configurations": {
183187
"production": {
184-
"cordovaBuildTarget": "app:ionic-cordova-build:production",
185188
"devServerTarget": "app:serve:production"
186189
}
187190
}
@@ -191,7 +194,11 @@
191194
},
192195
"cli": {
193196
"analytics": false,
194-
"schematicCollections": ["@ionic/angular-toolkit"]
197+
"schematicCollections": [
198+
"@cypress/schematic",
199+
"@ionic/angular-toolkit",
200+
"@schematics/angular"
201+
]
195202
},
196203
"schematics": {
197204
"@ionic/angular-toolkit:component": {

cypress.config.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig } from 'cypress';
2+
3+
export default defineConfig({
4+
e2e: {
5+
baseUrl: 'http://localhost:8100',
6+
},
7+
8+
component: {
9+
devServer: {
10+
framework: 'angular',
11+
bundler: 'webpack',
12+
},
13+
specPattern: '**/*.cy.ts',
14+
},
15+
});

cypress/e2e/spec.cy.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
describe('New App', () => {
2+
it('Visits the initial project page', () => {
3+
cy.visit('/');
4+
cy.contains('button', /Login|/);
5+
});
6+
});

cypress/fixtures/example.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]"
4+
}

cypress/support/commands.ts

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// ***********************************************
2+
// This example namespace declaration will help
3+
// with Intellisense and code completion in your
4+
// IDE or Text Editor.
5+
// ***********************************************
6+
// declare namespace Cypress {
7+
// interface Chainable<Subject = any> {
8+
// customCommand(param: any): typeof customCommand;
9+
// }
10+
// }
11+
//
12+
// function customCommand(param: any): void {
13+
// console.warn(param);
14+
// }
15+
//
16+
// NOTE: You can use it like so:
17+
// Cypress.Commands.add('customCommand', customCommand);
18+
//
19+
// ***********************************************
20+
// This example commands.js shows you how to
21+
// create various custom commands and overwrite
22+
// existing commands.
23+
//
24+
// For more comprehensive examples of custom
25+
// commands please read more here:
26+
// https://on.cypress.io/custom-commands
27+
// ***********************************************
28+
//
29+
//
30+
// -- This is a parent command --
31+
// Cypress.Commands.add("login", (email, password) => { ... })
32+
//
33+
//
34+
// -- This is a child command --
35+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
36+
//
37+
//
38+
// -- This is a dual command --
39+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
40+
//
41+
//
42+
// -- This will overwrite an existing command --
43+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

cypress/support/component-index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div data-cy-root></div>
11+
</body>
12+
</html>

cypress/support/component.ts

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// ***********************************************************
2+
// This example support/component.ts is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands';
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')
21+
22+
import { mount } from 'cypress/angular';
23+
24+
// Augment the Cypress namespace to include type definitions for
25+
// your custom command.
26+
// Alternatively, can be defined in cypress/support/component.d.ts
27+
// with a <reference path="./component" /> at the top of your spec.
28+
declare global {
29+
namespace Cypress {
30+
interface Chainable {
31+
mount: typeof mount;
32+
}
33+
}
34+
}
35+
36+
Cypress.Commands.add('mount', mount);
37+
38+
// Example use:
39+
// cy.mount(MyComponent)

cypress/support/e2e.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// ***********************************************************
2+
// This example support/e2e.ts is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// When a command from ./commands is ready to use, import with `import './commands'` syntax
17+
// import './commands';

cypress/tsconfig.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"include": ["**/*.ts"],
4+
"compilerOptions": {
5+
"sourceMap": false,
6+
"types": ["cypress"]
7+
}
8+
}

e2e/protractor.conf.js

-28
This file was deleted.

e2e/src/app.e2e-spec.ts

-14
This file was deleted.

e2e/src/app.po.ts

-12
This file was deleted.

e2e/tsconfig.json

-9
This file was deleted.

0 commit comments

Comments
 (0)