Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rburgst/test-ts-jest
https://github.com/rburgst/test-ts-jest
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rburgst/test-ts-jest
- Owner: rburgst
- Created: 2022-09-27T10:45:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-01T10:30:05.000Z (almost 2 years ago)
- Last Synced: 2024-11-08T17:53:07.144Z (about 2 months ago)
- Language: TypeScript
- Size: 135 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sample repo showing a ts-jest problem with preact and preact-testing-library
To reproduce run```
yarn install
yarn jest
```You will get
```
$ NODE_OPTIONS=--experimental-vm-modules jest
FAIL src/foo.test.tsx
● Test suite failed to runMust use import to load ES Module: /Users/user/test-ts-jest/node_modules/preact/dist/preact.mjs
> 1 | import { createRef, FunctionComponent } from 'preact';
| ^
2 | import React from 'preact/compat';
3 | import { useState } from 'preact/compat';
4 |at Runtime.requireModule (node_modules/jest-runtime/build/index.js:943:21)
at Object. (src/foo.tsx:1:1)
at Object. (src/foo.test.tsx:1:1)(node:23660) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
```