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
This works great with Next.js, however it does not work out-of-the-box with next/jest.js.
I am really not sure if this fits in this repo but I thought I would ask since this is the place for Typia/Next.js support currently - is there any proper way around this, and will you support it?
So I guess it uses SWC but it doesn't load webpack plugins (I think?) which makes sense in Jest. (Does unplugin-typia/next force Webpack or use the SWC Webpack loader? Not sure.)
But what is the proper solution? A generic Typia Jest transformer? Would that go here or require a new project?
How I picture it eventually working is maybe something like this:
importnextJestfrom"next/jest.js";constcreateJestConfig=nextJest({dir: "./",});constconfig=createJestConfig({transform: {"^.+\\.(ts|tsx)$": "@ryoppippi/unplugin-typia/next/jest",},/* Other options go here */});exportdefaultconfig;
EDIT: Previously I included a workaround, but it stopped working after I cleared my Jest cache. I'm considering Vitest.
The text was updated successfully, but these errors were encountered:
This works great with Next.js, however it does not work out-of-the-box with
next/jest.js
.I am really not sure if this fits in this repo but I thought I would ask since this is the place for Typia/Next.js support currently - is there any proper way around this, and will you support it?
You can check out the source for
next/jest
here if you want.The important part is that it sets up a transform for all JS/TS files to the Next.js SWC Jest transformer.
So I guess it uses SWC but it doesn't load webpack plugins (I think?) which makes sense in Jest. (Does
unplugin-typia/next
force Webpack or use the SWC Webpack loader? Not sure.)But what is the proper solution? A generic Typia Jest transformer? Would that go here or require a new project?
How I picture it eventually working is maybe something like this:
EDIT: Previously I included a workaround, but it stopped working after I cleared my Jest cache. I'm considering Vitest.
The text was updated successfully, but these errors were encountered: