Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

extend-expectexpect is not defined#465

Unanswered
dmvjs asked this question inQ&A
Discussion options

I get the following error (running playwright, using this dependency) and I don't seeexpect imported in the src file. Is it expected to be ok as-is or is there a known workaround?

I'm adding the new playwright "component tests" to a repo that already has playwright testing that works fine. It appears to happen as a result of calling themount method used for component testing.

I see that elsewhere in the code (in tests)describe(),expect(),test() are assumed to be available without being imported.

ReferenceError: expect is not defined   at node_modules/@testing-library/jest-dom/dist/extend-expect.js:9  7 | function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }  8 |> 9 | expect.extend(extensions);    | ^    at Object.<anonymous> (/Users/kelliott/Code/athena/src/client-v3/node_modules/@testing-library/jest-dom/dist/extend-expect.js:9:1)    at Object.<anonymous> (/Users/kelliott/Code/athena/src/client-v3/node_modules/@testing-library/jest-dom/extend-expect.js:2:1)```
You must be logged in to vote

Replies: 1 comment

Comment options

Well, in 2025 expect-extend does not exist in jest-dom AFAIK.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@dmvjs@gnietto

[8]ページ先頭

©2009-2025 Movatter.jp