Skip to content

Commit 7f8c40e

Browse files
authored
Merge pull request #72 from impresscms-dev/add-tests
Add tests
2 parents 37d050b + c7d44fd commit 7f8c40e

File tree

10 files changed

+192
-10626
lines changed

10 files changed

+192
-10626
lines changed

.github/workflows/on-pull-request.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,35 @@ on:
88
permissions: write-all
99

1010
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version:
17+
- 16.x
18+
19+
steps:
20+
- name: Checkouting code...
21+
uses: actions/checkout@v3
22+
with:
23+
ref: ${{ github.head_ref }}
24+
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
30+
- name: NPM install
31+
run: npm install
32+
33+
- name: NPM test
34+
run: npm run test
35+
1136
build:
1237

1338
runs-on: ubuntu-latest
39+
needs: test
1440

1541
strategy:
1642
matrix:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,4 @@ __tests__/runner/*
9999
lib/**/*
100100

101101
.idea/
102+
package-lock.json

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
transform: {'^.+\\.ts?$': 'ts-jest'},
3+
testEnvironment: 'node',
4+
testRegex: '/tests/.*\\.(test|spec)?\\.(ts|tsx)$',
5+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node']
6+
};

0 commit comments

Comments
 (0)