You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following error (running playwright, using this dependency) and I don't see expect 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 the mount 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)```
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I get the following error (running playwright, using this dependency) and I don't see
expect
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 the
mount
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.Beta Was this translation helpful? Give feedback.
All reactions