Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
all: add jest config
Browse files Browse the repository at this point in the history
  • Loading branch information
arnemolland committed Jul 25, 2022
1 parent 87c03b9 commit 549c086
Show file tree
Hide file tree
Showing 7 changed files with 3,833 additions and 230 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/* eslint-disable no-undef */
module.exports = {
extends: ['@gameflow-tv/eslint-config'],
extends: [
'@gameflow-tv/eslint-config',
'plugin:jest/recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
env: {
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,18 @@ jobs:
- name: Build library
run: npm run build

# TODO: Enable once we have a test script
# test:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2

# - uses: actions/setup-node@v2
# with:
# node-version: "18"

# - name: Install dependencies
# run: npm ci

# - name: Run tests
# run: npm test
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: "18"

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
16 changes: 16 additions & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const config = {
preset: 'ts-jest',
moduleDirectories: ['<rootDir>/node_modules', '<rootDir>/src', 'node_modules'],
testMatch: ['**/?(*.)+(spec|test).(js|ts)?(x)'],
extensionsToTreatAsEsm: ['.ts'],
globals: {
'ts-jest': {
useESM: true,
},
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
}

export default config
Loading

0 comments on commit 549c086

Please sign in to comment.