Cannot find module '@esm-bundle/chai' from 'node_modules/@open-wc/testing/index.js'
When i run yarn test to execute "jest" command it says:
Cannot find module '@esm-bundle/chai' from 'node_modules/@open-wc/testing/index.js'

import { fixture, fixtureCleanup } from "@open-wc/testing";
import { html } from "lit-element";
import type * as Silly from "./silly"
// requireActual ensures you get the real file
// instead of an automock
// we use import type and <typeof ...> to still get types
const { sillyFunction } = jest.requireActual<typeof Silly>("./silly")
describe("silly function", () => {
test("guaranteed random", () => {
expect(sillyFunction()).toBe(4)
})
})
Versions i am using: "@open-wc/testing": "^3.1.7" "jest": "^29.3.1" "typescript": "^4.9.4" "ts-jest": "^29.0.5"
I used @open-wc/testing-helpers and it works perfectly but its not working with @open-wc/testing
+1 having the same problem with pnpm and Vitest
running into this issue as well. any luck?
Quite interesting that this happens as @esm-bundle/chai is a dependency of @open-wc/testing and not one of @open-wc/testing-helpers. Would you be able to share a more complete repro?
I am also experiencing issues with this in yarn/vitest. Doesn't matter the version i specify, it seems like the latest is affected (4.0.0). Not sure what i need to do to fix this.
Having same problem with vitest and yarn v4
The problem is @open-wc/testing depends on "@esm-bundle/chai": "^4.3.4-fix.0",
When using yarn "^4.3.4-fix.0" resolves to "4.3.4" (the broken release) and not to "4.3.4-fix.0"
I tried to add a specific version dependency to my project "@esm-bundle/chai": "4.3.4-fix.0" but did not fixed (now i have 2 versions of @esm-bundle/chai)
I added "resolutions": { "@esm-bundle/chai": "4.3.4-fix.0" }
To root package.json and fixed