-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
"Expected 1 arguments, but got 2." except with mysterious workarounds #65
Comments
I had some luck by adding the package to my tsconfig types. {
"compilerOptions": {
"types": ["jest", "jest-expect-message"]
}
} |
There is an alternative to explicitly declared {
"devDependencies": {
"@types/jest-expect-message": "npm:jest-expect-message@*",
}
} Run |
The suggestion from @mrazauskas worked for me. I was also able to remove the |
I am using:
Following the config steps proposed in the ReadMe of this package didn't work for me either. More specifically, the step where the To get it working I had to do the following:
{
"compilerOptions": {
"types": ["jest", "jest-expect-message"]
}
} Doing these steps allowed me to use the jest-expect-message package without further issues. PS: Adding the |
Bug
package
version: 1.1.3node
version: 16.16.0npm
(oryarn
) version: npm 8.11.0What I tried initially
Initially the only things I did before using messages in expect were
npm install --save-dev jest-expect-message
import "jest-expect-message";
tojest-setup.ts
.This worked initially but after change the test and running the test again, I started getting:
What didn't work
I tried of all the following but the issue remained:
"jest-expect-message",
tosetupFilesAfterEnv:
injest.config.cjs
."files": ["node_modules/jest-expect-message/types/index.d.ts"],
totsconfig.json
"jest/valid-expect": "off",
inrules:
in.eslintrc.cjs
.What worked
jest --clearCache
the issue would go away, but return after making some changes and running the test again.npm install --save-dev @types/jest-expect-message
made the issue go away consistently. However, the package is deprecated and when I look inside the package it looks basically empty. So I don't understand how this can have an effect.import "jest-expect-message";
in the test file itself rather than injest-setup.ts
works. Is this the intended way to use it?Any insight into what might be going on would be greatly appreciated.
If you want, you can see our entire setup at dfinity/nns-dapp@main...kloet/jem3
The text was updated successfully, but these errors were encountered: