Skip to content

Commit

Permalink
Unit tests
Browse files Browse the repository at this point in the history
- added dev dependencies on `jest`, `nock` and `eslint-plugin-jest`
- added test cases for class `CallbackUriNotifier`
- added GitHub Action
  • Loading branch information
tg666 committed Nov 13, 2023
1 parent a46725e commit 66c001f
Show file tree
Hide file tree
Showing 6 changed files with 6,595 additions and 3,118 deletions.
13 changes: 10 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"env": {
"node": true,
"es6": true,
"browser": true
"browser": true,
"jest/globals": true
},
"extends": "eslint:recommended",
"overrides": [],
Expand All @@ -15,6 +16,12 @@
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": ["error", { "before": false, "after": true }],
"no-trailing-spaces": "error",
"eol-last": ["error", "always"]
}
"eol-last": ["error", "always"],
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error"
},
"plugins": ["jest"]
}
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests

on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main

env:
PUPPETEER_SKIP_DOWNLOAD: true
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true

jobs:
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install dependencies
run: npm install

- name: Jest
run: npm test
Loading

0 comments on commit 66c001f

Please sign in to comment.