Skip to content

Commit 1db13fb

Browse files
authored
Merge pull request #61 from algorandfoundation/jest-docs-tweak
chore: tweak jest docs
2 parents cf53888 + 5c30420 commit 1db13fb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Let's write a simple contract and test it using the `algorand-typescript-testing
4444

4545
#### Configuring vitest
4646

47-
If you are using [vitest](https://vitest.dev/) with [@rollup/plugin-typescript](https://www.npmjs.com/package/@rollup/plugin-typescript) plugin, configure `puyaTsTransformer` as a `before` stage transformer of `typescript` plugin in `vitest.config.mts` file.
47+
If you are using [vitest](https://vitest.dev/) with [@rollup/plugin-typescript](https://www.npmjs.com/package/@rollup/plugin-typescript) plugin, configure `puyaTsTransformer` as a `before` stage transformer of the `typescript` plugin in `vitest.config.mts` file.
4848

4949
```typescript
5050
import typescript from '@rollup/plugin-typescript'
@@ -79,7 +79,7 @@ beforeAll(() => {
7979

8080
#### Configuring jest
8181

82-
If you are using [jest](https://jestjs.io/) with [ts-jest](https://www.npmjs.com/package/ts-jest), [@jest/globals](https://www.npmjs.com/package/@jest/globals) and [ts-node](https://www.npmjs.com/package/ts-node) plugins, configure `puyaTsTransformer` as a `before` stage transformer of `typescript` plugin in `jest.config.ts` file.
82+
If you are using [jest](https://jestjs.io/) with [ts-jest](https://www.npmjs.com/package/ts-jest), [@jest/globals](https://www.npmjs.com/package/@jest/globals) and [ts-node](https://www.npmjs.com/package/ts-node) plugins, configure `puyaTsTransformer` as a `before` stage transformer of the `typescript` plugin in `jest.config.ts` file.
8383

8484
```typescript
8585
import { createDefaultEsmPreset, type JestConfigWithTsJest } from 'ts-jest'
@@ -116,13 +116,16 @@ beforeAll(() => {
116116
})
117117
```
118118

119-
It is also handy to add in a script to run `jest` with `--experimental-vm-modules` flag in `package.json`.
119+
You'll also need to run `jest` with the `--experimental-vm-modules` and `--experimental-require-module` flags in the `package.json`. This requires node 20.17 or greater.
120120

121121
```json
122122
{
123123
"name": "puya-ts-demo",
124124
"scripts": {
125-
"test:jest": "tsc && node --experimental-vm-modules node_modules/jest/bin/jest"
125+
"test:jest": "tsc && node --experimental-vm-modules --experimental-require-module node_modules/jest/bin/jest"
126+
},
127+
"engines": {
128+
"node": ">=20.17"
126129
}
127130
}
128131
```

0 commit comments

Comments
 (0)