Skip to content

Commit

Permalink
Merge pull request #28 from 9elements/feature/angular-15
Browse files Browse the repository at this point in the history
Update to Angular 15
  • Loading branch information
molily committed Jan 28, 2023
2 parents 055709c + 7dde25d commit a206d46
Show file tree
Hide file tree
Showing 19 changed files with 4,596 additions and 17,233 deletions.
17 changes: 0 additions & 17 deletions .browserslistrc

This file was deleted.

12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The application is fully tested with unit and end-to-end tests.

Unit tests are written in plain Angular using `TestBed` and additionally using [Spectator](https://github.com/ngneat/spectator).

End-to-end tests are written with [Cypress](https://www.cypress.io/) and also with [Protractor](http://www.protractortest.org/).
End-to-end tests are written with [Cypress](https://www.cypress.io/).

**[App structure plan (React version)](https://github.com/molily/learning-react/tree/main/5-flickr-search)**

Expand All @@ -35,18 +35,16 @@ Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app w

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.

## Running unit & integration tests
## Running the unit & integration tests

Run `ng test` to execute the unit & integration tests with Karma and Jasmine.

## Running end-to-end tests

### Cypress
## Running the end-to-end tests with Cypress

Run `ng run flickr-search:cypress-run` to execute the Cypress end-to-end tests. (This starts the development server automatically.)

Run `ng run flickr-search:cypress-open` to start the interactive Cypress test runner.

### Protractor
## Deployment

Run `ng e2e` to execute the Protractor end-to-end tests. (This starts the development server automatically.)
Run `npm run deploy` to the deploy the code to [https://9elements.github.io/angular-flickr-search/].
64 changes: 30 additions & 34 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@
"outputPath": "dist/flickr-search",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -85,39 +80,18 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"styles": [
"src/styles.css"
],
"styles": ["src/styles.css"],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
"assets": ["src/favicon.ico", "src/assets"]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "flickr-search:serve"
},
"configurations": {
"production": {
"devServerTarget": "flickr-search:serve:production"
}
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
},
"deploy": {
Expand All @@ -141,11 +115,33 @@
"watch": true,
"headless": false
}
},
"e2e": {
"builder": "@cypress/schematic:cypress",
"options": {
"devServerTarget": "flickr-search:serve",
"watch": true,
"headless": false
},
"configurations": {
"production": {
"devServerTarget": "flickr-search:serve:production"
}
}
}
}
}
},
"cli": {
"analytics": false
"analytics": false,
"schematicCollections": ["@cypress/schematic", "@schematics/angular"]
},
"schematics": {
"@angular-eslint/schematics:application": {
"setParserOptionsProject": true
},
"@angular-eslint/schematics:library": {
"setParserOptionsProject": true
}
}
}
7 changes: 4 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { defineConfig } from 'cypress'
import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:4200',
video: false
video: false,
experimentalRunAllSpecs: true,
},
})
});
6 changes: 2 additions & 4 deletions cypress/e2e/flickr-search-stub-network.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ describe('Flickr search (with network stubbing)', () => {
};

beforeEach(() => {
cy.server();
cy.route({
url: expectedUrl,
response: flickrResponse,
cy.intercept('GET', expectedUrl, {
headers: {
'Access-Control-Allow-Origin': '*',
},
body: flickrResponse,
}).as('flickrSearchRequest');

cy.visit('/');
Expand Down
40 changes: 0 additions & 40 deletions e2e/protractor.conf.js

This file was deleted.

28 changes: 0 additions & 28 deletions e2e/src/e2e.spec-helper.ts

This file was deleted.

39 changes: 0 additions & 39 deletions e2e/src/flickr-search-with-po.e2e-spec.ts

This file was deleted.

47 changes: 0 additions & 47 deletions e2e/src/flickr-search.e2e-spec.ts

This file was deleted.

52 changes: 0 additions & 52 deletions e2e/src/flickr-search.po.ts

This file was deleted.

Loading

0 comments on commit a206d46

Please sign in to comment.