Comments (9)
This does not appear to be released yet. When can we expect a 2.1.3 with this fix? Right now we're using jest 25 because we can't get 27 to work until this is out.
from svelte-jester.
Sorry about the delay, released 2.1.3
!
from svelte-jester.
I will add some tests that mimic the usual usage to get this covered, finally.
from svelte-jester.
Reproduction steps:
- Run
npm init svelte@next
- Edit
tsconfig.json
to remove comments (sonpx apply rossyman/svelte-add-jest
won't throw) - Run
npx apply rossyman/svelte-add-jest
- Run
npm install
- Run
npm run test
and see the exception that Jest throws
from svelte-jester.
Can confirm that #75 fixes this issue for me.
from svelte-jester.
For anyone else waiting for 2.1.3
, I cloned and published the master branch to svelte-jester-pre-fix
. To use it you can temporarily add "svelte-jester": "npm:svelte-jester-pre-fix@^2.1.3"
to your devDependencies until the official 2.1.3
has been released.
It has fixed all issues for me but YMMV.
from svelte-jester.
Thank you for the update! However, still having some issues: though not sure if I'm the only one, but still getting an error about the preprocess.js file:
FAIL src/components/Layout.test.ts
● Test suite failed to run
Cannot find module './preprocess.js'
Require stack:
- /home/asode/coding/my-svelte-vite-test/node_modules/svelte-jester/dist/transformer.cjs
- /home/asode/coding/my-svelte-vite-test/node_modules/jest-util/build/requireOrImportModule.js
- /home/asode/coding/my-svelte-vite-test/node_modules/jest-util/build/index.js
- /home/asode/coding/my-svelte-vite-test/node_modules/@jest/core/build/cli/index.js
- /home/asode/coding/my-svelte-vite-test/node_modules/@jest/core/build/jest.js
- /home/asode/coding/my-svelte-vite-test/node_modules/jest-cli/build/cli/index.js
- /home/asode/coding/my-svelte-vite-test/node_modules/jest-cli/bin/jest.js
- /home/asode/coding/my-svelte-vite-test/node_modules/jest/bin/jest.js
Require stack:
node_modules/svelte-jester/dist/transformer.cjs
node_modules/jest-util/build/requireOrImportModule.js
node_modules/jest-util/build/index.js
node_modules/@jest/core/build/cli/index.js
node_modules/@jest/core/build/jest.js
node_modules/jest-cli/build/cli/index.js
node_modules/jest-cli/bin/jest.js
node_modules/jest/bin/jest.js
at Object.processSync [as process] (node_modules/svelte-jester/dist/transformer.cjs:115:32)
at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:612:31)
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:758:40)
at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:815:19)
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.24",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/svelte": "^3.0.3",
"@tsconfig/svelte": "^2.0.1",
"@types/cssnano": "^4.0.1",
"@types/jest": "^27.0.1",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"autoprefixer": "^10.3.4",
"cssnano": "^5.0.8",
"eslint-plugin-svelte3": "^3.2.1",
"jest": "^27.2.0",
"postcss": "^8.3.6",
"postcss-load-config": "^3.1.0",
"svelte": "^3.42.6",
"svelte-check": "^2.2.6",
"svelte-jester": "^2.1.3",
"svelte-navigator": "^3.1.5",
"svelte-preprocess": "^4.9.4",
"tailwindcss": "^2.2.15",
"ts-jest": "^27.0.5",
"ts-node": "^10.2.1",
"tslib": "^2.3.1",
"typescript": "^4.4.3",
"vite": "^2.5.10"
}
from svelte-jester.
I'm also getting that issue. When I look in the svelte-jester
folder in node modules it appears that the preprocess
file is missing; there's just a transformer.cjs
and a transformer.mjs
file in the dist directory. Is it possible that something went wrong in the build process when publishing v2.1.3?
from svelte-jester.
Yeah, sorry about that. Will be fixed, see #81
from svelte-jester.
Related Issues (20)
- Add presets like vue-jest
- Svelte 4 support HOT 7
- Add mechanism to call beforeEach() and afterEach() manually inside an it block HOT 1
- Allow to use CJS with Svelte 4 without throwing an error HOT 3
- Call `compileModule` for `.svelte.js` files in Svelte 5 HOT 8
- Phantom file listed in coverage HOT 2
- Transformer.js must export a "process" function - jester v2.0.1 jest 27 HOT 33
- Support components mocks HOT 2
- yarn vs npm
- jestOptions?.transformerConfig Unexpected token '.' HOT 2
- TypeError [ERR_INVALID_ARG_TYPE] HOT 16
- Cannot find module './preprocess.js' HOT 13
- TypeError [ERR_INVALID_ARG_TYPE] - Sapper HOT 2
- Cannot import from context="module" HOT 10
- Image imports that use typescript alias returns undefined HOT 1
- ParseError: Colon is expected (svelte with scss style) HOT 1
- Coverage of untested files not collected HOT 8
- Completely fails when using preprocessing HOT 4
- <svelte:component/> breaks rendering with `TypeError: switch_value is not a constructor` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-jester.