Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Unit Tests"

on:
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches:
- master
- "v[0-9]+.[0-9]+"
tags:
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"

jobs:
define-versions:
runs-on: ubuntu-latest
outputs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
cdiVersions: ${{ steps.versions.outputs.cdiVersions }}
nodeVersions: '["18.20", "20.19", "22.14"]'
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-supported-versions-action@main
id: versions
with:
has-fdi: true
has-cdi: true

test:
runs-on: ubuntu-latest
needs: define-versions
strategy:
fail-fast: false
matrix:
node-version: ${{ fromJSON(needs.define-versions.outputs.nodeVersions) }}
cdi-version: ${{ fromJSON(needs.define-versions.outputs.cdiVersions) }}
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-versions-action@main
id: versions
with:
driver-name: node
cdi-version: ${{ matrix.cdi-version }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm install
- name: Run unit tests
run: |
docker compose up --wait
npm run test
docker compose down
env:
SUPERTOKENS_CORE_VERSION: ${{ steps.versions.outputs.coreVersionXy }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ releasePassword
/temp_*
/.nyc_output
.circleci/.pat
test-results*
7 changes: 5 additions & 2 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
spec: test/**/*.test.js
exit: true
slow: 10000
timeout: 20000
reporter: spec
timeout: 40000
reporter: mocha-multi-reporters
require: test/hooks.js
reporter-option:
- configFile=mocha-multi-reporters.json
9 changes: 9 additions & 0 deletions mocha-multi-reporters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"reporterEnabled": "spec, mocha-junit-reporter, mocha-json-output-reporter",
"mochaJunitReporterReporterOptions": {
"mochaFile": "test-results.xml"
},
"mochaJsonOutputReporterReporterOptions": {
"output": "test-results.json"
}
}
Loading
Loading