Skip to content

Commit e51e2e7

Browse files
Create app with test - did not reproduce bug
0 parents  commit e51e2e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+20675
-0
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.eslintrc.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["!**/*"],
4+
"plugins": ["@nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts"],
8+
"extends": [
9+
"plugin:@nx/angular",
10+
"plugin:@angular-eslint/template/process-inline-templates"
11+
],
12+
"rules": {
13+
"@angular-eslint/directive-selector": [
14+
"error",
15+
{
16+
"type": "attribute",
17+
"prefix": "ngTestingBug",
18+
"style": "camelCase"
19+
}
20+
],
21+
"@angular-eslint/component-selector": [
22+
"error",
23+
{
24+
"type": "element",
25+
"prefix": "ng-testing-bug",
26+
"style": "kebab-case"
27+
}
28+
]
29+
}
30+
},
31+
{
32+
"files": ["*.html"],
33+
"extends": ["plugin:@nx/angular-template"],
34+
"rules": {}
35+
}
36+
]
37+
}

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
dist
5+
tmp
6+
/out-tsc
7+
8+
# dependencies
9+
node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
.nx/cache
42+
.angular

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache
5+
.angular

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"firsttris.vscode-jest-runner",
6+
"dbaeumer.vscode-eslint"
7+
]
8+
}

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# NgTestingBug
2+
3+
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
4+
5+
**This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)**
6+
7+
8+
## Start the app
9+
10+
To start the development server run `nx serve ng-testing-bug`. Open your browser and navigate to http://localhost:4200/. Happy coding!
11+
12+
13+
## Generate code
14+
15+
If you happen to use Nx plugins, you can leverage code generators that might come with it.
16+
17+
Run `nx list` to get a list of available plugins and whether they have generators. Then run `nx list <plugin-name>` to see what generators are available.
18+
19+
Learn more about [Nx generators on the docs](https://nx.dev/plugin-features/use-code-generators).
20+
21+
## Running tasks
22+
23+
To execute tasks with Nx use the following syntax:
24+
25+
```
26+
nx <target> <project> <...options>
27+
```
28+
29+
You can also run multiple targets:
30+
31+
```
32+
nx run-many -t <target1> <target2>
33+
```
34+
35+
..or add `-p` to filter specific projects
36+
37+
```
38+
nx run-many -t <target1> <target2> -p <proj1> <proj2>
39+
```
40+
41+
Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/core-features/run-tasks).
42+
43+
## Want better Editor Integration?
44+
45+
Have a look at the [Nx Console extensions](https://nx.dev/nx-console). It provides autocomplete support, a UI for exploring and running tasks & generators, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users.
46+
47+
## Ready to deploy?
48+
49+
Just run `nx build demoapp` to build the application. The build artifacts will be stored in the `dist/` directory, ready to be deployed.
50+
51+
## Set up CI!
52+
53+
Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further.
54+
55+
- [Set up remote caching](https://nx.dev/core-features/share-your-cache)
56+
- [Set up task distribution across multiple machines](https://nx.dev/core-features/distribute-task-execution)
57+
- [Learn more how to setup CI](https://nx.dev/recipes/ci)
58+
59+
## Connect with us!
60+
61+
- [Join the community](https://nx.dev/community)
62+
- [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
63+
- [Follow us on Twitter](https://twitter.com/nxdevtools)

e2e/.eslintrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": ["plugin:cypress/recommended", "../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.js", "*.jsx"],
7+
"extends": ["plugin:@nx/javascript"],
8+
"rules": {}
9+
},
10+
{
11+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
12+
"rules": {}
13+
}
14+
],
15+
"plugins": ["@nx"]
16+
}

e2e/cypress.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { defineConfig } from 'cypress';
2+
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
3+
4+
export default defineConfig({
5+
e2e: nxE2EPreset(__dirname),
6+
});

e2e/project.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "e2e",
3+
"$schema": "../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "e2e/src",
5+
"projectType": "application",
6+
"targets": {
7+
"e2e": {
8+
"executor": "@nx/cypress:cypress",
9+
"options": {
10+
"cypressConfig": "e2e/cypress.config.ts",
11+
"devServerTarget": "ng-testing-bug:serve:development",
12+
"testingType": "e2e"
13+
},
14+
"configurations": {
15+
"production": {
16+
"devServerTarget": "ng-testing-bug:serve:production"
17+
},
18+
"ci": {
19+
"devServerTarget": "ng-testing-bug:serve-static"
20+
}
21+
}
22+
},
23+
"lint": {
24+
"executor": "@nx/eslint:lint",
25+
"outputs": ["{options.outputFile}"],
26+
"options": {
27+
"lintFilePatterns": ["e2e/**/*.{js,ts}"]
28+
}
29+
}
30+
},
31+
"tags": [],
32+
"implicitDependencies": ["ng-testing-bug"]
33+
}

e2e/src/e2e/app.cy.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { getGreeting } from '../support/app.po';
2+
3+
describe('ng-testing-bug', () => {
4+
beforeEach(() => cy.visit('/'));
5+
6+
it('should display welcome message', () => {
7+
// Custom command example, see `../support/commands.ts` file
8+
cy.login('[email protected]', 'myPassword');
9+
10+
// Function helper example, see `../support/app.po.ts` file
11+
getGreeting().contains('Welcome ng-testing-bug');
12+
});
13+
});

e2e/src/fixtures/example.json

Lines changed: 4 additions & 0 deletions
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+
}

e2e/src/support/app.po.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const getGreeting = () => cy.get('h1');

e2e/src/support/commands.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
11+
// eslint-disable-next-line @typescript-eslint/no-namespace
12+
declare namespace Cypress {
13+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
14+
interface Chainable<Subject> {
15+
login(email: string, password: string): void;
16+
}
17+
}
18+
//
19+
// -- This is a parent command --
20+
Cypress.Commands.add('login', (email, password) => {
21+
console.log('Custom command example: Login', email, password);
22+
});
23+
//
24+
// -- This is a child command --
25+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
26+
//
27+
//
28+
// -- This is a dual command --
29+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
30+
//
31+
//
32+
// -- This will overwrite an existing command --
33+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

e2e/src/support/e2e.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// ***********************************************************
2+
// This example support/index.js 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';

e2e/tsconfig.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"sourceMap": false,
5+
"outDir": "../dist/out-tsc",
6+
"allowJs": true,
7+
"types": ["cypress", "node"],
8+
"forceConsistentCasingInFileNames": true,
9+
"strict": true,
10+
"noImplicitOverride": true,
11+
"noPropertyAccessFromIndexSignature": true,
12+
"noImplicitReturns": true,
13+
"noFallthroughCasesInSwitch": true
14+
},
15+
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
16+
}

jest.config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'ng-testing-bug',
4+
preset: './jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
coverageDirectory: './coverage/ng-testing-bug',
7+
transform: {
8+
'^.+\\.(ts|mjs|js|html)$': [
9+
'jest-preset-angular',
10+
{
11+
tsconfig: '<rootDir>/tsconfig.spec.json',
12+
stringifyContentPathRegex: '\\.(html|svg)$',
13+
},
14+
],
15+
},
16+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
17+
snapshotSerializers: [
18+
'jest-preset-angular/build/serializers/no-ng-attributes',
19+
'jest-preset-angular/build/serializers/ng-snapshot',
20+
'jest-preset-angular/build/serializers/html-comment',
21+
],
22+
testMatch: [
23+
'<rootDir>/src/**/__tests__/**/*.[jt]s?(x)',
24+
'<rootDir>/src/**/*(*.)@(spec|test).[jt]s?(x)',
25+
],
26+
};

jest.preset.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const nxPreset = require('@nx/jest/preset').default;
2+
3+
module.exports = { ...nxPreset };

0 commit comments

Comments
 (0)