Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] Unknown config option "transform" on jest v0.17 #56

Closed
redstrike opened this issue Nov 9, 2016 · 11 comments
Closed

[ERROR] Unknown config option "transform" on jest v0.17 #56

redstrike opened this issue Nov 9, 2016 · 11 comments

Comments

@redstrike
Copy link

 The settings `scriptPreprocessor` and `preprocessorIgnorePatterns` were replaced 
  by `transform` and `transformIgnorePatterns` which support multiple preprocessors.

  Jest now treats your current settings as:

    "transform": {".*": "./node_modules/ts-jest/preprocessor.js"}

Error: Unknown config option "transform" with value "[object Object]". This is either 
a typing error or a user mistake and fixing it will remove this message.

I don't sure this is an error message from jest or ts-jest. But most of my test suites are written in TypeScript, so I think that I will post this issue here.

Node v7.0
Jest v0.17

@Igmat
Copy link
Contributor

Igmat commented Nov 9, 2016

Ok. It was unexpected breaking change for us.
After updating jest, I see that tests are working. They just have this warn in output. Are you facing some other problems?

@Igmat Igmat mentioned this issue Nov 9, 2016
@Igmat
Copy link
Contributor

Igmat commented Nov 9, 2016

Ok, this was fixed in 57e8753.
Try to use "ts-jest": "17.0.0". If you'll face some problems feel free to re-open this issues.

@Igmat Igmat closed this as completed Nov 9, 2016
@redstrike
Copy link
Author

redstrike commented Nov 10, 2016

@Igmat: jest run normally, but the error message still there, which causes some confusing.

Error: Unknown config option "transform" with value "[object Object]". This is either a typing
error or a user mistake and fixing it will remove this message.
npm ls jest ts-jest typescript
+-- jest@17.0.0
+-- ts-jest@17.0.0
`-- UNMET PEER DEPENDENCY typescript@2.1.1

npm ERR! peer dep missing: typescript@~2.0.6, required by ts-jest@17.0.0

And please keep the configuration docs for version 0.1.13, because jest's website doesn't include it anymore.

@Igmat
Copy link
Contributor

Igmat commented Nov 10, 2016

@redstrike, could you, please, create a simple repro for this?
And I've added link to previous doc in readme.

@Igmat Igmat reopened this Nov 10, 2016
@redstrike
Copy link
Author

@Igmat, It seems that if I copy all of the test and source files + the same tsconfig.json & package.json to a new directory, install jest 17.0 + ts-jest 17.0. The error message no longer appears.

I have tried to remove and reinstall them in my current project:

npm rm -D jest ts-jest
npm i -D jest ts-jest

But the error message still appears in my current project.
I am using Windows 10 x64 Pro 1607, node 7.0, typescript@next.


Unfortunately, I have to roll back to jest 16, due to the latest jest and ts-jest cannot understand the usage of async/await in my source code and tests.

it("can remember the last state after be rendered", function () __awaiter(this, void 0, void 0, function* () {
                                                                ^^^^^^^^^
SyntaxError: Unexpected identifier
      at transformAndBuildScript (node_modules\jest\node_modules\jest-runtime\build\transform.js:316:10)

@Igmat
Copy link
Contributor

Igmat commented Nov 10, 2016

Ok, so what is your node version and tsconfig?

@redstrike
Copy link
Author

Oh, sorry. I forgot to mention that. I'm on mobile now. But you can see my current tsconfig.json at this issue: jestjs/jest#2073

Node v7.0

@Igmat
Copy link
Contributor

Igmat commented Nov 14, 2016

@redstrike, sorry for delay. I'll take a look on it tomorrow.

@redstrike
Copy link
Author

@Igmat, thank you for your supportive. Without ts-jest, I could not figure out how to apply Jest into my trivial TypeScript project. Jest team has closed my issue jestjs/jest#2073 :)

@Igmat
Copy link
Contributor

Igmat commented Nov 15, 2016

@redstrike, your problem is very strange - I can't reproduce it on Windows 10 x64 Enterprise with node v7 and typescript@next. Using your settings from jestjs/jest#2073 I get another output from tsc:

it("can remember the last state after be rendered", function () { return __awaiter(_this, void 0, void 0, function () {

which doesn't cause any errors.
Could you, please, provide a simple repro with async/await?

@redstrike
Copy link
Author

@Igmat, it seems that the issue has been solved on TypeScript side 😀
Last week, I was using TypeScript v2.1.0-dev.20161110. Today, I did a re-test with TypeScript v2.2.0-dev.20161111. The bug is no longer happen 😮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants