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 think I'm running into a similar issue as #1876 (which is also me, but different account / repos).
I'm trying to integrate @web/test-runner with @testing-library/dom. Here's a test:
import { expect } from '@esm-bundle/chai';
import { Input } from './input';
import { fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { getByText } from '@testing-library/dom';
describe('foo-input', () => {
it('renders content', async () => {
const content = 'foo';
const container = await fixture<Input>(html`<foo-input>${content}</foo-input>`);
const el = await getByText(container, content);
expect(el instanceof Input).eql(true);
});
});
This fails with:
🚧 Browser logs:
SyntaxError: The requested module './../../../../@babel/runtime/regenerator/index.js' does not provide an export named 'default'
❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information.
🚧 Browser logs:
SyntaxError: The requested module './../../../../lz-string/libs/lz-string.js' does not provide an export named 'compressToEncodedURIComponent'
❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information.
Per the advice in the docs, I've also tried to list out the specific node modules which exhibit console errors:
🚧 Browser logs:
SyntaxError: The requested module './../../../../@babel/runtime/regenerator/index.js' does not provide an export named 'default'
❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information.
Any recommendations on next steps?
The text was updated successfully, but these errors were encountered:
Hey @keviddles - I've been struggling with similar. I believe #1700 is related. My project uses @testing-library/react-hooks. I have @rollup/plugin-commonjs pinned to "^18.0.0" and the following config, which works for me:
commonjsPlugin({
include: [
// Allows @testing-library/react-hooks to be consumed as an ES module
'node_modules/@testing-library/**/*',
'node_modules/react-dom/**/*',
'node_modules/object-assign/**/*',
'node_modules/scheduler/**/*',
'node_modules/prop-types/**/*'
],
}),
Hello,
I think I'm running into a similar issue as #1876 (which is also me, but different account / repos).
I'm trying to integrate
@web/test-runner
with@testing-library/dom
. Here's a test:This fails with:
testing-library
exports a variety of builds. All three exhibit the problem. By default the ESM build is loaded.Per the advice on #1876, I tried to integrate the rollup commonjs plugin. Here's what my config looks like:
That produces:
Per the advice in the docs, I've also tried to list out the specific node modules which exhibit console errors:
Which produces:
Any recommendations on next steps?
The text was updated successfully, but these errors were encountered: