Skip to content

Commit

Permalink
chore: Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Aug 10, 2024
1 parent 8743493 commit 9fbda1e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Tests

on:
push:
branches: [master]
pull_request:
branches: ['**']

jobs:
test:
name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
cache: 'npm'
- name: Install packages for project
run: npm ci
- name: Run tests
run: |
cd test
npm start
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"lint": "./bin/lint"
},
"scripts": {
"test": "exit 0"
"test": "cd test && npm start"
},
"exports": {
"./eslint-config": "./eslint-common-config.js",
Expand Down
7 changes: 7 additions & 0 deletions test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "test",
"private": true,
"scripts": {
"start": "npm i ../ && npx @diplodoc/lint install"
}
}

0 comments on commit 9fbda1e

Please sign in to comment.