Skip to content

Commit

Permalink
Merge branch 'testing-200-meal-planner-indirect-output-starter' into …
Browse files Browse the repository at this point in the history
…testing-201-meal-planner-indirect-output
  • Loading branch information
yjaaidi committed Nov 3, 2023
2 parents fc18c07 + 1d6156a commit 9909f32
Show file tree
Hide file tree
Showing 58 changed files with 18,717 additions and 20,135 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: ✅ Test
on:
push:

env:
# Using Nx Cloud is safer
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0

jobs:
test:
name: ✅ Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: ${{ github.ref_name }}

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Cache Nx
uses: actions/cache@v3
with:
path: .nx/cache
key: ${{ runner.os }}-nx-${{ github.sha }}
restore-keys: ${{ runner.os }}-nx

- uses: pnpm/action-setup@v2
with:
version: 8

- run: pnpm install

- run: pnpm nx run-many --parallel=4 -t build,lint,test

# Skip Cypress Component tests on branches that don't have them
# this avoids no specs error and polluting the code base
# with some cypress test file from the beginning.
- id: has-cypress-tests
run: |
if [ $(find apps libs -name '*.cy.ts' | wc -l) -gt 0 ]; then
echo "::set-output name=has-cypress-tests::true"
else
echo "::set-output name=has-cypress-tests::false"
fi
- name: Cypress component tests
if: steps.has-cypress-tests.outputs.has-cypress-tests == 'true'
run: pnpm nx run-many --parallel=4 -t component-test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ Thumbs.db
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions
.nx/cache

.cache
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

/dist
/coverage

/.nx/cache
12 changes: 12 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true
},
"target": "es2020"
}
}


3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint",
"rebornix.project-snippets"
"rebornix.project-snippets",
"ms-playwright.playwright"
]
}
783 changes: 0 additions & 783 deletions .yarn/releases/yarn-berry.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

17 changes: 0 additions & 17 deletions apps/whiskmate-e2e/.eslintrc.json

This file was deleted.

12 changes: 0 additions & 12 deletions apps/whiskmate-e2e/cypress.json

This file was deleted.

30 changes: 0 additions & 30 deletions apps/whiskmate-e2e/project.json

This file was deleted.

4 changes: 0 additions & 4 deletions apps/whiskmate-e2e/src/fixtures/example.json

This file was deleted.

13 changes: 0 additions & 13 deletions apps/whiskmate-e2e/src/integration/app.spec.ts

This file was deleted.

19 changes: 0 additions & 19 deletions apps/whiskmate-e2e/src/plugins/index.js

This file was deleted.

1 change: 0 additions & 1 deletion apps/whiskmate-e2e/src/support/app.po.ts

This file was deleted.

33 changes: 0 additions & 33 deletions apps/whiskmate-e2e/src/support/commands.ts

This file was deleted.

17 changes: 0 additions & 17 deletions apps/whiskmate-e2e/src/support/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions apps/whiskmate-e2e/tsconfig.e2e.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/whiskmate-e2e/tsconfig.json

This file was deleted.

6 changes: 5 additions & 1 deletion apps/whiskmate/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../.eslintrc.json",
"extends": ["plugin:playwright/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
Expand Down Expand Up @@ -31,6 +31,10 @@
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
},
{
"files": ["**/*.pw.{ts,js,tsx,jsx}"],
"rules": {}
}
]
}
8 changes: 1 addition & 7 deletions apps/whiskmate/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ export default {
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../coverage/apps/whiskmate',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
'^.+\\.m?(t|j)sx?$': ['@swc/jest'],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
Expand Down
23 changes: 23 additions & 0 deletions apps/whiskmate/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from '@jscutlery/playwright-ct-angular';
import { nxE2EPreset } from '@nx/playwright/preset';

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
...nxE2EPreset(__filename, { testDir: '.' }),
testMatch: ['**/*.pw.ts'],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',

ctViteConfig: {
resolve: {
/* @angular/material is using "style" as a Custom Conditional export to expose prebuilt styles etc... */
conditions: ['style'],
},
},
},
timeout: 10_000,
});
12 changes: 12 additions & 0 deletions apps/whiskmate/playwright/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Testing Page</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./index.ts"></script>
</body>
</html>
1 change: 1 addition & 0 deletions apps/whiskmate/playwright/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '../src/styles.css';
Loading

0 comments on commit 9909f32

Please sign in to comment.