Skip to content

Commit

Permalink
Fixed failing CI by:
Browse files Browse the repository at this point in the history
- updating GitHub runner,
- adjusting nvm settings,
- added pattern to also run tests in docs folder,
- Refactored the naming pattern to not use dash but dot (e.g. use e2e.spec.ts instead of e2e-spec.ts)

Also tried to configure tests debugging in VSCode but didn't work as the breakpoint is not caught.
  • Loading branch information
oskardudycz committed Feb 16, 2024
1 parent 8eba349 commit 0293f3a
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# selected operation systems to run CI
os: [ubuntu-latest] #, windows-latest, macos-latest]
# selected node version to run CI
node-version: [20.10.x]
node-version: [21.6.2]

steps:
- name: Check Out Repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 21.6.2
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ jobs:
- name: Check Out Repo
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
# use the node version defined in matrix above
node-version: ${{ matrix.node-version }}
cache: 'npm'
node-version: lts
cache: npm # or pnpm / ya

- name: Install dependencies
run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.10.0
v21.6.2
38 changes: 26 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,34 @@
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"name": "Debug current file",
"type": "node",
"request": "launch",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "start", "--", "--inspect-brk=9229"],
"port": 9229
},
{
"name": "Debug Server",
"type": "node",
"request": "launch",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "start:server", "--", "--inspect-brk=9229"],
"port": 9229

// Debug current file in VSCode
"program": "${file}",

/*
Path to tsx binary
Assuming locally installed
*/
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/tsx",

/*
Open terminal when debugging starts (Optional)
Useful to see console.logs
*/
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",

// Files to exclude from debugger (e.g. call stack)
"skipFiles": [
// Node.js internal core modules
"<node_internals>/**",

// Ignore all dependencies (optional)
"${workspaceFolder}/node_modules/**"
]
},
{
"name": "Jest all tests",
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"lint": "npm run lint --ws",
"fix": "npm run fix --ws",
"test": "run-s test:unit test:int test:e2e",
"test:unit": "node --import tsx --test packages/**/*.spec.ts",
"test:int": "node --import tsx --test packages/**/*.int-spec.ts",
"test:e2e": "node --import tsx --test packages/**/*.e2e-spec.ts",
"test:watch": "node --import tsx --test --watch",
"test:unit:watch": "node --import tsx --test --watch packages/**/*.spec.ts",
"test:int:watch": "node --import tsx --test --watch packages/**/*.int-spec.ts",
"test:e2e:watch": "node --import tsx --test --watch packages/**/*.e2e-spec.ts",
"test:unit": "node --import tsx --test packages/**/*.unit.spec.ts docs/**/*.unit .spec.ts docs/**/*.unit.spec.ts",
"test:int": "node --import tsx --test packages/**/*.int .spec.ts docs/**/*.int.spec.ts",
"test:e2e": "node --import tsx --test packages/**/*.e2e .spec.ts docs/**/*.e2e.spec.ts",
"test:watch": "node --import tsx --test --watch **/* .spec.ts docs/**/*.unit.spec.ts",
"test:unit:watch": "node --import tsx --test --watch packages/**/*.unit .spec.ts docs/**/*.unit.spec.ts",
"test:int:watch": "node --import tsx --test --watch packages/**/*.int .spec.ts docs/**/*.int.spec.ts",
"test:e2e:watch": "node --import tsx --test --watch packages/**/*.e2e .spec.ts docs/**/*.e2e.spec.ts",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
Expand Down Expand Up @@ -69,4 +69,4 @@
"packages/emmett-esdb",
"packages/emmett-expressjs"
]
}
}
12 changes: 6 additions & 6 deletions packages/emmett-esdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"fix:prettier": "prettier --write \"**/**/!(*.d).{ts,json,md}\"",
"fix:eslint": "eslint **/*.ts --fix",
"test": "run-s test:unit test:int test:e2e",
"test:unit": "node --import tsx --test ./src/**/*.spec.ts",
"test:int": "node --import tsx --test ./src/**/*.int-spec.ts",
"test:e2e": "node --import tsx --test ./src/**/*.e2e-spec.ts",
"test:unit": "node --import tsx --test ./src/**/*.unit .spec.ts docs/**/*.unit.spec.ts",
"test:int": "node --import tsx --test ./src/**/*.int .spec.ts docs/**/*.int.spec.ts",
"test:e2e": "node --import tsx --test ./src/**/*.e2e .spec.ts docs/**/*.e2e.spec.ts",
"test:watch": "node --import tsx --test --watch",
"test:unit:watch": "node --import tsx --test --watch ./src/**/*.spec.ts",
"test:int:watch": "node --import tsx --test --watch ./src/**/*.int-spec.ts",
"test:e2e:watch": "node --import tsx --test --watch ./src/**/*.e2e-spec.ts"
"test:unit:watch": "node --import tsx --test --watch ./src/**/*.unit .spec.ts docs/**/*.unit.spec.ts",
"test:int:watch": "node --import tsx --test --watch ./src/**/*.int .spec.ts docs/**/*.int.spec.ts",
"test:e2e:watch": "node --import tsx --test --watch ./src/**/*.e2e .spec.ts docs/**/*.e2e.spec.ts"
},
"repository": {
"type": "git",
Expand Down
12 changes: 6 additions & 6 deletions packages/emmett-expressjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"fix:prettier": "prettier --write \"**/**/!(*.d).{ts,json,md}\"",
"fix:eslint": "eslint **/*.ts --fix",
"test": "run-s test:unit test:int test:e2e",
"test:unit": "node --import tsx --test ./src/**/*.spec.ts",
"test:int": "node --import tsx --test ./src/**/*.int-spec.ts",
"test:e2e": "node --import tsx --test ./src/**/*.e2e-spec.ts",
"test:unit": "node --import tsx --test ./src/**/*.unit .spec.ts docs/**/*.unit.spec.ts",
"test:int": "node --import tsx --test ./src/**/*.int .spec.ts docs/**/*.int.spec.ts",
"test:e2e": "node --import tsx --test ./src/**/*.e2e .spec.ts docs/**/*.e2e.spec.ts",
"test:watch": "node --import tsx --test --watch",
"test:unit:watch": "node --import tsx --test --watch ./src/**/*.spec.ts",
"test:int:watch": "node --import tsx --test --watch ./src/**/*.int-spec.ts",
"test:e2e:watch": "node --import tsx --test --watch ./src/**/*.e2e-spec.ts"
"test:unit:watch": "node --import tsx --test --watch ./src/**/*.unit .spec.ts docs/**/*.unit.spec.ts",
"test:int:watch": "node --import tsx --test --watch ./src/**/*.int .spec.ts docs/**/*.int.spec.ts",
"test:e2e:watch": "node --import tsx --test --watch ./src/**/*.e2e .spec.ts docs/**/*.e2e.spec.ts"
},
"repository": {
"type": "git",
Expand Down
12 changes: 6 additions & 6 deletions packages/emmett/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"fix:prettier": "prettier --write \"**/**/!(*.d).{ts,json,md}\"",
"fix:eslint": "eslint **/*.ts --fix",
"test": "run-s test:unit test:int test:e2e",
"test:unit": "node --import tsx --test ./src/**/*.spec.ts",
"test:int": "node --import tsx --test ./src/**/*.int-spec.ts",
"test:e2e": "node --import tsx --test ./src/**/*.e2e-spec.ts",
"test:unit": "node --import tsx --test ./src/**/*.unit .spec.ts docs/**/*.unit.spec.ts",
"test:int": "node --import tsx --test ./src/**/*.int .spec.ts docs/**/*.int.spec.ts",
"test:e2e": "node --import tsx --test ./src/**/*.e2e .spec.ts docs/**/*.e2e.spec.ts",
"test:watch": "node --import tsx --test --watch",
"test:unit:watch": "node --import tsx --test --watch ./src/**/*.spec.ts",
"test:int:watch": "node --import tsx --test --watch ./src/**/*.int-spec.ts",
"test:e2e:watch": "node --import tsx --test --watch ./src/**/*.e2e-spec.ts"
"test:unit:watch": "node --import tsx --test --watch ./src/**/*.unit .spec.ts docs/**/*.unit.spec.ts",
"test:int:watch": "node --import tsx --test --watch ./src/**/*.int .spec.ts docs/**/*.int.spec.ts",
"test:e2e:watch": "node --import tsx --test --watch ./src/**/*.e2e .spec.ts docs/**/*.e2e.spec.ts"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
"declaration": true /* Generates corresponding '.d.ts' file. */,
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
"sourceMap": true /* Generates corresponding '.map' file. */,
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./dist" /* Redirect output structure to the directory. */,
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
Expand Down

0 comments on commit 0293f3a

Please sign in to comment.