You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! :)
I've just added wouter-preact to my preact + typescript boilerplate. I'm using ts-jest for tests with ts-jest preset. Unfortunately I cannot test app.tsx component which contains import { Link, Route } from 'wouter-preact';
After running yarn test I've got:
FAIL src/app/app.spec.tsx
● Test suite failed to run
/home/mk/Documents/repos/preact-ts-parcel/node_modules/wouter-preact/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import locationHook from "./use-location.js";
^^^^^^^^^^^^
SyntaxError: Unexpected identifier
1 | import { h } from 'preact';
> 2 | import { Link, Route } from 'wouter-preact';
| ^
3 | import { TypedComponent } from '../shared/typings/prop-types';
4 | import { actions, StoreState } from '../store';
5 | import { useAction, useSelector } from '@preact-hooks/unistore';
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25)
I'm not saying that this is a problem with wouter-preact itself, because it may be e.g. ts-jest problem or maybe even I did something wrong in terms of configuration (see below) but could you add also commonjs output?
Hey @kolodziejczakM thanks for the interest in the project. wouter-preact package is relatively new and didn't come with bundled CJS source, while the main package did.
I have just released a patch version v2.3.1 of both packages with proper Preact CJS sources. In wouter-preact@2.3.1 you will have:
Hello! :)
I've just added wouter-preact to my preact + typescript boilerplate. I'm using ts-jest for tests with ts-jest preset. Unfortunately I cannot test app.tsx component which contains
import { Link, Route } from 'wouter-preact';
After running
yarn test
I've got:I'm not saying that this is a problem with wouter-preact itself, because it may be e.g. ts-jest problem or maybe even I did something wrong in terms of configuration (see below) but could you add also commonjs output?
jest.config.js
tsconfig.json:
I've been trying with different tsconfig.json configurations (also without "include" & || "exclude" fields) but without success.
Related issue (?): #70
The text was updated successfully, but these errors were encountered: