Skip to content

Commit

Permalink
adapt jest config and github workflow t otry fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
julia05 committed Feb 7, 2025
1 parent 9c71eb7 commit a193779
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,32 @@

name: Node.js CI

permissions:
contents: read

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# cache: 'npm'
- name: Install dependencies
run: npm ci
- run: npm run build --if-present
- run: npm test
4 changes: 3 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const config = {
// roots: [
// "<rootDir>"
// ],
roots: ["./tests"],
roots: ["./tests", "./node_modules"],

modulePaths: ["./src", "./node_modules"],

// A preset that is used as a base for Jest's configuration
preset: "ts-jest",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "/dist/src/app.js",
"type": "module",
"scripts": {
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"test": "node --trace-warnings --experimental-vm-modules node_modules/jest/bin/jest.js",
"build": "npx tsc",
"start": "node dist/app.js",
"dev": "nodemon src/app.ts"
Expand Down

0 comments on commit a193779

Please sign in to comment.