Skip to content

Add jest and a simple test example #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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
12 changes: 12 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,15 @@ jobs:
run: "npm ci"
- name: Run ESLint
run: "npm run lint"

testing:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-node@v3"
with:
check-latest: true
- name: "Install node modules"
run: "npm ci"
- name: Run Jest
run: "npm run test"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN mkdir -p /usr/local/source
WORKDIR /usr/local/source
COPY package*.json ./
COPY tsconfig.json ./
COPY webpack.config.js ./
COPY webpack.config.ts ./
RUN npm ci
COPY ./src ./src
RUN npm run build
Expand Down
11 changes: 11 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// eslint-disable-next-line node/no-unpublished-import
import {Config} from 'jest';

const config: Config = {
reporters : [ 'default', 'github-actions' ],
transform : {'^.+\\.ts?$': 'ts-jest'},
testEnvironment : 'node',
testRegex : '/src/.*\\.spec\\.ts$',
};

export default config;
Loading