Skip to content

Commit

Permalink
Merge pull request #10 from Souler/master
Browse files Browse the repository at this point in the history
Migrate to Jest and Github Actions
  • Loading branch information
3imed-jaberi authored Oct 12, 2024
2 parents d172efe + 5063133 commit fb68a65
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 34 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Node.js CI

on:
push:
branches:
- master
pull_request:
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 test -- --coverage --maxWorkers 2
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
12 changes: 0 additions & 12 deletions .nycrc

This file was deleted.

10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

14 changes: 4 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
"main": "index.js",
"scripts": {
"lint": "xo",
"pretest": "npm run lint",
"test": "mocha",
"precoverage": "rimraf .nyc_output coverage",
"coverage": "nyc npm run test",
"preci": "echo start CI ........",
"ci": "npm run coverage"
"test": "jest"
},
"repository": {
"type": "git",
Expand All @@ -32,9 +27,8 @@
"license": "MIT",
"devDependencies": {
"eslint-config-xo-lass": "^1.0.3",
"jest": "^29.7.0",
"koa": "^2.12.1",
"mocha": "^8.0.1",
"nyc": "^15.1.0",
"supertest": "^4.0.2",
"xo": "^0.32.0"
},
Expand All @@ -60,8 +54,8 @@
}
},
"engines": {
"node": ">= 10"
},
"node": ">= 18"
},
"homepage": "https://github.com/koajs/accesslog",
"bugs": {
"url": "https://github.com/koajs/accesslog/issues"
Expand Down
4 changes: 2 additions & 2 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ describe('lib accesslog', function () {
let agent;
let server;

before(function (done) {
beforeAll(function (done) {
server = app.listen(done);
agent = request.agent(server);
});

after(function () {
afterAll(function () {
server.close();
});

Expand Down

0 comments on commit fb68a65

Please sign in to comment.