Skip to content

Commit

Permalink
chore: fix ci and pause coverage for bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
spence-s committed Dec 21, 2024
1 parent 0b457c4 commit e1a7266
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 41 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,31 @@ name: Node.js CI

on:
push:
branch: master
branches: [master]
pull_request:
branch: master
branches: [master]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm run test:coverage
- run: npx codecov
continue-on-error: true
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm run build
# https://github.com/nodejs/node/issues/55054 multiple issues with experimental code coverage
# with source maps make test coverage unusable.
# TODO: use code coverage when it is fixed by node core teams
- run: npm run test
# - run: npm run test:coverage
# - run: npx codecov
# continue-on-error: true
7 changes: 5 additions & 2 deletions __tests__/application/respond.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import statuses from 'statuses'
import assert from 'assert'
import Koa from '../../dist/application.js'
import fs from 'fs'
import path from 'path'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const pkg = JSON.parse(fs.readFileSync(path.join(import.meta.dirname, '..', '..', 'package.json')))
const __dirname = path.dirname(fileURLToPath(import.meta.url))

const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json')))

describe('app.respond', () => {
describe('when ctx.respond === false', () => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"format": "standard --fix && xo --fix",
"lint": "standard && xo",
"lint:pretty": "standard | snazzy",
"test": "node --test",
"test:coverage": "node --test --experimental-test-coverage"
"test": "node --enable-source-maps --test",
"test:coverage": "node --enable-source-maps --test --experimental-test-coverage"
},
"prettier": {
"plugins": [
Expand Down
18 changes: 2 additions & 16 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
/**
* Minimal TypeScript configuration for Node.js
* - To choose between native ESM or CJS modules, simply change the "type" option in package.json.
* ESM is the default option for the spence-s-starter-template, but the tscofig is set up to use commonjs when the package.json field is changed to "type": "commonjs", or removed.
*/
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"target": "ES2022",
"module": "Node16",
"rootDir": "./lib",
"strict": true,
"declaration": true,
"sourceMap": true,
"paths": {
"koa-compose": ["./lib/types/koa-compose.d.ts"],
"cache-content-type": ["./lib/types/cache-content-type.d.ts"],
"delegates": ["./lib/types/delegates.d.ts"]
}
"rootDir": "./lib"
},
"include": ["**/*"]
}
10 changes: 2 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
/**
* Minimal TypeScript configuration for Node.js
* - To choose between native ESM or CJS modules, simply change the "type" option in package.json.
* ESM is the default option for the spence-s-starter-template, but the tscofig is set up to use commonjs when the package.json field is changed to "type": "commonjs", or removed.
*/
{
"compilerOptions": {
"outDir": "./dist",
"target": "ES2022",
"target": "ES2023",
"module": "Node16",
"rootDir": ".",
"strict": true,
"declaration": true,
"sourceMap": true,
"paths": {
"koa-compose": ["./lib/types/koa-compose.d.ts"],
"cache-content-type": ["./lib/types/cache-content-type.d.ts"],
"delegates": ["./lib/types/delegates.d.ts"]
"cache-content-type": ["./lib/types/cache-content-type.d.ts"]
}
}
}

0 comments on commit e1a7266

Please sign in to comment.