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: Invalid Chai property: calledTwice #155

Open
naissa12 opened this issue Mar 24, 2022 · 1 comment
Open

Error: Invalid Chai property: calledTwice #155

naissa12 opened this issue Mar 24, 2022 · 1 comment

Comments

@naissa12
Copy link

Error: Invalid Chai property: calledTwice
    at Object.e [as get] (.tmp/karma_webpack/commons.js:149088:1519)
    at Context.<anonymous> (.tmp/karma_webpack/commons.js:3840:101)
    at Test.Runnable.run (/home/asruser/project/common/temp/node_modules/.pnpm/karma-mocha-snapshot@0.2.1/node_modules/karma-mocha-snapshot/lib/adapter.js:14:17)

I'm seeing the error above when running unit tests. Can someone please help? I have sinon-chai installed. See my package.json:

      "@types/chai": "4.2.14",
       "@types/chai-as-promised": "7.1.3",
       "@types/query-selector-shadow-dom": "1.0.0",
       "@types/node": "14.14.36",
       "@types/sinon": "9.0.8",
       "@types/sinon-chai": "3.2.5",
@cincodenada
Copy link
Contributor

cincodenada commented Apr 14, 2022

That package.json snippet is not including sinon-chai (or chai, for that matter), it's including the DefinitelyTyped type definitions for Chai. Are you including the actual chai and sinon-chai elsewhere in your package.json?

Also, we won't really be able to help without seeing what your test code is doing - at least a snippet that's calling calledTwice and the part where you set up sinon-chai.

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