Skip to content

Commit

Permalink
add executor
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Sep 3, 2024
1 parent 913c3fb commit 2cc3e30
Show file tree
Hide file tree
Showing 10 changed files with 7,409 additions and 3,188 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"ignorePatterns": ["**/*"],
"overrides": [
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
},
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
Expand Down
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode"]
"recommendations": [
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner"
]
}
9 changes: 9 additions & 0 deletions e2e-examples/cli-e2e-env/setup/global-setup-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { writeFile } from 'node:fs/promises';

export async function setup() {
await writeFile('tmp/setup.txt', 'Hello World from setup hook');
}

export async function teardown() {
await writeFile('tmp/teardown.txt', 'Hello World from setup hook');
}
24 changes: 10 additions & 14 deletions e2e/cli-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "projects/cli-e2e/test",
"projectType": "library",
"tags": [
"type:example",
"npm-env"
],
"implicitDependencies": [
"cli"
],
"tags": ["npm-env"],
"implicitDependencies": ["cli"],
"targets": {
"setup": {
"executor": "environment-plugin:setup-env",
"options": {
"workspaceRoot": "tmp/e2e/cli-e2e"
}
},
"e2e": {
"dependsOn": [
{
Expand All @@ -20,13 +21,8 @@
}
],
"executor": "@nx/vite:test",
"inputs": [
"default",
"^production"
],
"outputs": [
"{options.reportsDirectory}"
],
"inputs": ["default", "^production"],
"outputs": ["{options.reportsDirectory}"],
"options": {
"reportsDirectory": "../../coverage/projects/cli-e2e"
}
Expand Down
23 changes: 22 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/eslint.config.js",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json"
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/src/test-setup.[jt]s",
"!{projectRoot}/test-setup.[jt]s"
],
"sharedGlobals": []
},
Expand Down Expand Up @@ -40,6 +43,24 @@
},
"build": {
"inputs": ["production", "^production"]
},
"@nx/js:tsc": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"@nx/jest:jest": {
"cache": true,
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"options": {
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"plugins": [
Expand Down
Loading

0 comments on commit 2cc3e30

Please sign in to comment.