Closed staff0rd closed 3 years ago
I cloned the repo, ran npm ci
, and the npm test
. This is with Node v16.1.0:
PASS src/App.test.tsx
FAIL src/db.test.ts
● Test suite failed to run
"messageParent" can only be used inside a worker
at messageParent (node_modules/jest-worker/build/workers/messageParent.js:46:11)
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 1.056 s
Ran all test suites.
Watch Usage: Press w to show more.
Not sure why it's a different error than yours. Regardless, I think it's likely that your error message is not actually related to fake-indexeddb and is probably instead related to either Dexie or Jest. See the README for some examples that work with either Dexie or Jest.
Oddly I was getting that too but not always, I hit enter during watch when it happened and it ran the test with the original error.
The code in the repo (see the commit linked) is based on the readme.
On 13 May 2021, at 3:00 am, Jeremy Scheff @.***> wrote:
I cloned the repo, ran npm ci, and the npm test. This is with Node v16.1.0:
PASS src/App.test.tsx FAIL src/db.test.ts ● Test suite failed to run
"messageParent" can only be used inside a worker at messageParent (node_modules/jest-worker/build/workers/messageParent.js:46:11)
Test Suites: 1 failed, 1 passed, 2 total Tests: 1 passed, 1 total Snapshots: 0 total Time: 1.056 s Ran all test suites.
Watch Usage: Press w to show more. Not sure why it's a different error than yours. Regardless, I think it's likely that your error message is not actually related to fake-indexeddb and is probably instead related to either Dexie or Jest. See the README for some examples that work with either Dexie or Jest.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
@staff0rd did you find a solution, or a cause, since you closed this issue?
If I remember correctly, I did not find the direct cause, but I worked around my need for the library by mocking my data access functions instead of Dexie/indexedDb.
I tried using with latest dexie inside a CRA, but it doesn't seem to work:
Fails with:
repro