Skip to content

Commit

Permalink
Merge pull request #133 from NoriginMedia/unit-tests
Browse files Browse the repository at this point in the history
Add initial battery of tests
  • Loading branch information
xavi160 authored Jun 4, 2024
2 parents 19ceeb1 + de91345 commit a708581
Show file tree
Hide file tree
Showing 11 changed files with 8,739 additions and 2,781 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: pull-request

on: pull_request

jobs:
test:
runs-on: ubuntu-latest
name: Test
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test -- --colors
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ node_modules

# Build folder
dist

# Ignore test coverage reports
coverage
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
testMatch: ['**/__tests__/**/*.test.[jt]s?(x)'],
collectCoverageFrom: [
'src/**/*.ts',
'!src/__tests__/**',
'!**/node_modules/**',
'!**/coverage/**'
]
};
Loading

0 comments on commit a708581

Please sign in to comment.