jest-expect-message
                                
                                 jest-expect-message copied to clipboard
                                
                                    jest-expect-message copied to clipboard
                            
                            
                            
                        still getting "Expect takes at most one argument" error
Bug
- packageversion:
- nodeversion:
- npm(or- yarn) version:
Relevant code or config
What you did:
- install pkg yarn add -D jest-expect-message
- add the following to my package.json:
  "jest": {
    "setupFilesAfterEnv": [
      "jest-expect-message"
    ]
  },
- wrote a test block and ran with Jest:
test('foo', () => {
   expect(1, 'wah wah').toBe(0);
});
What happened (please provide anything you think will help):
Failed test with this message: Expect takes at most one argument.
Reproduction repository (if possible):
Same here. I installed it according to the guide but I get the same error as @zebralight . Would be nice to get it working :)
You sure it isn't an eslint message? I had the same thing:
https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/valid-expect.md
/* eslintrc.json */
"rules": {
  "jest/valid-expect": "off",
},
or typescript:
yarn add @types/jest-expect-message --dev
Both of those fixed any issue.
Bug
packageversion:
nodeversion:
npm(oryarn) version:Relevant code or config
What you did:
- install pkg
yarn add -D jest-expect-message- add the following to my
package.json:"jest": { "setupFilesAfterEnv": [ "jest-expect-message" ] },
- wrote a test block and ran with Jest:
test('foo', () => { expect(1, 'wah wah').toBe(0); });What happened (please provide anything you think will help): Failed test with this message:
Expect takes at most one argument.Reproduction repository (if possible):
I'm using this module from typeScript, and i had the same problem. To fix it, i had to:
- run yarn add @types/jest-expect-message --dev
- import 'jest-expect-message'from one of the test files
Going to close this as I don't think any of these issues are still valid with the latest release: https://www.npmjs.com/package/jest-expect-message/v/1.0.4
Please feel free to re-open / comment if the issues persist 👍