Skip to content

Commit

Permalink
jest.config,CI: convert to typescript
Browse files Browse the repository at this point in the history
The --config parameter is included due to the fact that tsc
creates a jest.config.js file. If this parameter is not
specified, we encounter an error stating:
"Multiple configurations found".

Also we need to install ts-node:

```
  Error: Jest: 'ts-node' is required for the TypeScript configuration files. Make sure it is installed
```
  • Loading branch information
Mersho authored and knocte committed Jan 29, 2024
1 parent 148d1d0 commit 56f2421
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
- name: Install yarn
run: |
npm install --global yarn
yarn add --dev jest typescript ts-jest @types/jest
yarn add --dev jest typescript ts-jest @types/jest ts-node
- name: Run typescript compiler
run: npx tsc
- name: Print versions
Expand All @@ -144,7 +144,7 @@ jobs:
npx commitlint --version
yarn --version
- name: Run tests to validate our plugins
run: yarn jest
run: yarn jest --config jest.config.ts

sanity-check:
name: Sanity check
Expand Down
5 changes: 0 additions & 5 deletions jest.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { Config } from "@jest/types";

const config: Config.InitialOptions = {
preset: "ts-jest",
testEnvironment: "node",
};

export default config;

0 comments on commit 56f2421

Please sign in to comment.