-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c973294
commit 8f024e4
Showing
146 changed files
with
5,588 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"fileServerFolder": ".", | ||
"fixturesFolder": "./src/fixtures", | ||
"integrationFolder": "./src/integration", | ||
"modifyObstructiveCode": false, | ||
"pluginsFile": "./src/plugins/index", | ||
"supportFile": "./src/support/index.ts", | ||
"video": true, | ||
"videosFolder": "../../dist/cypress/apps/example-app-e2e/videos", | ||
"screenshotsFolder": "../../dist/cypress/apps/example-app-e2e/screenshots", | ||
"chromeWebSecurity": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "hello@cypress.io" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { getGreeting } from '../support/app.po'; | ||
|
||
describe('example-app', () => { | ||
beforeEach(() => cy.visit('/')); | ||
|
||
it('should display welcome message', () => { | ||
// Custom command example, see `../support/commands.ts` file | ||
cy.login('my-email@something.com', 'myPassword'); | ||
|
||
// Function helper example, see `../support/app.po.ts` file | ||
getGreeting().contains('Welcome to example-app!'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor'); | ||
|
||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
|
||
// Preprocess Typescript file using Nx helper | ||
on('file:preprocessor', preprocessTypescript(config)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const getGreeting = () => cy.get('h1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// eslint-disable-next-line @typescript-eslint/no-namespace | ||
declare namespace Cypress { | ||
interface Chainable<Subject> { | ||
login(email: string, password: string): void; | ||
} | ||
} | ||
// | ||
// -- This is a parent command -- | ||
Cypress.Commands.add('login', (email, password) => { | ||
console.log('Custom command example: Login', email, password); | ||
}); | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"sourceMap": false, | ||
"outDir": "../../dist/out-tsc", | ||
"allowJs": true | ||
}, | ||
"include": ["src/**/*.ts", "src/**/*.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"types": ["cypress", "node"] | ||
}, | ||
"include": ["**/*.ts", "**/*.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": "../../tslint.json", | ||
"linterOptions": { "exclude": ["!**/*"] }, | ||
"rules": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. | ||
# For additional information regarding the format and rule options, please see: | ||
# https://github.com/browserslist/browserslist#queries | ||
|
||
# You can see what browsers were selected by your queries by running: | ||
# npx browserslist | ||
|
||
> 0.5% | ||
last 2 versions | ||
Firefox ESR | ||
not dead | ||
not IE 9-11 # For IE 9-11 support, remove 'not'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
name: 'example-app', | ||
preset: '../../jest.config.js', | ||
coverageDirectory: '../../coverage/apps/example-app', | ||
snapshotSerializers: [ | ||
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', | ||
'jest-preset-angular/build/AngularSnapshotSerializer.js', | ||
'jest-preset-angular/build/HTMLCommentSerializer.js', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { AuthGuard } from '@example-app/auth/services'; | ||
import { NotFoundPageComponent } from '@example-app/core/containers'; | ||
|
||
export const routes: Routes = [ | ||
{ path: '', redirectTo: '/books', pathMatch: 'full' }, | ||
{ | ||
path: 'books', | ||
loadChildren: () => | ||
import('@example-app/books/books.module').then((m) => m.BooksModule), | ||
canActivate: [AuthGuard], | ||
}, | ||
{ | ||
path: '**', | ||
component: NotFoundPageComponent, | ||
data: { title: 'Not found' }, | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes, { useHash: true })], | ||
exports: [RouterModule], | ||
}) | ||
export class AppRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { HttpClientModule } from '@angular/common/http'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | ||
|
||
import { StoreModule } from '@ngrx/store'; | ||
import { EffectsModule } from '@ngrx/effects'; | ||
import { StoreRouterConnectingModule, RouterState } from '@ngrx/router-store'; | ||
import { StoreDevtoolsModule } from '@ngrx/store-devtools'; | ||
|
||
import { AuthModule } from '@example-app/auth'; | ||
|
||
import { ROOT_REDUCERS, metaReducers } from '@example-app/reducers'; | ||
|
||
import { CoreModule } from '@example-app/core'; | ||
import { AppRoutingModule } from '@example-app/app-routing.module'; | ||
import { UserEffects, RouterEffects } from '@example-app/core/effects'; | ||
import { AppComponent } from '@example-app/core/containers'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
BrowserModule, | ||
BrowserAnimationsModule, | ||
HttpClientModule, | ||
AuthModule, | ||
AppRoutingModule, | ||
|
||
/** | ||
* StoreModule.forRoot is imported once in the root module, accepting a reducer | ||
* function or object map of reducer functions. If passed an object of | ||
* reducers, combineReducers will be run creating your application | ||
* meta-reducer. This returns all providers for an @ngrx/store | ||
* based application. | ||
*/ | ||
StoreModule.forRoot(ROOT_REDUCERS, { | ||
metaReducers, | ||
runtimeChecks: { | ||
// strictStateImmutability and strictActionImmutability are enabled by default | ||
strictStateSerializability: true, | ||
strictActionSerializability: true, | ||
strictActionWithinNgZone: true, | ||
strictActionTypeUniqueness: true, | ||
}, | ||
}), | ||
|
||
/** | ||
* @ngrx/router-store keeps router state up-to-date in the store. | ||
*/ | ||
StoreRouterConnectingModule.forRoot(), | ||
|
||
/** | ||
* Store devtools instrument the store retaining past versions of state | ||
* and recalculating new states. This enables powerful time-travel | ||
* debugging. | ||
* | ||
* To use the debugger, install the Redux Devtools extension for either | ||
* Chrome or Firefox | ||
* | ||
* See: https://github.com/zalmoxisus/redux-devtools-extension | ||
*/ | ||
StoreDevtoolsModule.instrument({ | ||
name: 'NgRx Book Store App', | ||
|
||
// In a production build you would want to disable the Store Devtools | ||
// logOnly: environment.production, | ||
}), | ||
|
||
/** | ||
* EffectsModule.forRoot() is imported once in the root module and | ||
* sets up the effects class to be initialized immediately when the | ||
* application starts. | ||
* | ||
* See: https://ngrx.io/guide/effects#registering-root-effects | ||
*/ | ||
EffectsModule.forRoot([UserEffects, RouterEffects]), | ||
CoreModule, | ||
], | ||
bootstrap: [AppComponent], | ||
}) | ||
export class AppModule {} |
Oops, something went wrong.