Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Feb 14, 2024
1 parent 317ea21 commit d2eb997
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Tests

on: [push]

jobs:
tests-on:
name: ${{matrix.go-version}} ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.21.x]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"
- run: npm ci
- run: npm run build --if-present
- run: npm test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.vscode
.vscode
coverage
22 changes: 14 additions & 8 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
module.exports = {
transform: {
'^.+\\.ts?$': 'ts-jest',
},
testEnvironment: 'node',
testRegex: './src/.*\\.(test|spec)?\\.(ts|ts)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
roots: ['<rootDir>/src'],
};
preset: "ts-jest",
transform: {
"^.+\\.ts?$": "ts-jest",
},
testEnvironment: "node",
testRegex: "./src/.*\\.(test|spec)?\\.(ts|ts)$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
roots: ["<rootDir>/src"],
collectCoverage: true,
coverageReporters: ["lcov", "text-summary"],
collectCoverageFrom: ["src/**/*.ts"],
coveragePathIgnorePatterns: ["/node_modules/", "/__tests__/"],
testPathIgnorePatterns: ["/node_modules/"],
};

0 comments on commit d2eb997

Please sign in to comment.