Skip to content

Commit

Permalink
Merge pull request #14 from thiagomini/refactor/use-node-native-test-…
Browse files Browse the repository at this point in the history
…runners

Refactor/use node native test runners
  • Loading branch information
oskardudycz committed Feb 19, 2024
2 parents 65b2d90 + 52c205b commit 3c0b7e5
Show file tree
Hide file tree
Showing 20 changed files with 2,299 additions and 6,030 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: [20.11.1]

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: 20.11.1
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
v20.11.1
47 changes: 32 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,46 @@
"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

// 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": "Debug Server",
"name": "Debug All Tests (Node)",
"type": "node",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "start:server", "--", "--inspect-brk=9229"],
"port": 9229
},
{
"name": "Jest all tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"args": ["--verbose", "-i", "--no-cache", "--watchAll"],
"runtimeArgs": ["run-script", "test", "--inspect-brk=9229"], // Use --inspect-brk for debugging
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}",
"sourceMaps": true
},
{
"name": "Jest current test",
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"files.eol": "\n",

"typescript.preferences.importModuleSpecifier": "relative",
"eslint.workingDirectories": [{ "mode": "auto" }]
"eslint.workingDirectories": [{ "mode": "auto" }],
"debug.javascript.terminalOptions": {
"nodeVersionHint": 20
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it } from 'node:test';
import { v4 as uuid } from 'uuid';
import { decide } from './businessLogic';
import { evolve, getInitialState } from './state';
Expand Down
23 changes: 0 additions & 23 deletions jest.config.js

This file was deleted.

1 change: 0 additions & 1 deletion jest.setup.js

This file was deleted.

0 comments on commit 3c0b7e5

Please sign in to comment.