-
-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Bug
packageversion: 1.1.3nodeversion: 16.16.0npm(oryarn) version: npm 8.11.0
What I tried initially
Initially the only things I did before using messages in expect were
npm install --save-dev jest-expect-message- Add
import "jest-expect-message";tojest-setup.ts.
This worked initially but after change the test and running the test again, I started getting:
> @dfinity/nns-dapp@2.0.17 test
> TZ=UTC jest "feature-flags.store.spec.ts"
FAIL src/tests/lib/stores/feature-flags.store.spec.ts
β Test suite failed to run
src/tests/lib/stores/feature-flags.store.spec.ts:24:9 - error TS2554: Expected 1 arguments, but got 2.
24 `FeatureFlag ${feature} should be exported from feature-flags.store.ts`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 2.076 s
Ran all test suites matching /feature-flags.store.spec.ts/i.
What didn't work
I tried of all the following but the issue remained:
- Add
"jest-expect-message",tosetupFilesAfterEnv:injest.config.cjs. - Add
"files": ["node_modules/jest-expect-message/types/index.d.ts"],totsconfig.json - Add
"jest/valid-expect": "off",inrules:in.eslintrc.cjs.
What worked
- After running
jest --clearCachethe issue would go away, but return after making some changes and running the test again. npm install --save-dev @types/jest-expect-messagemade 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.- Using
import "jest-expect-message";in the test file itself rather than injest-setup.tsworks. 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels