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'm trying to mock prismjs because there seems to be an issue with the runner not being able to pick up its exports (code works fine so I know the exports exist).
Original error:
Browser logs:
SyntaxError: The requested module '/__wds-outside-root__/2/node_modules/prismjs/prism.js' does not provide an export named 'highlight'
I added import map plugin:
``
import { importMapsPlugin } from '@web/dev-server-import-maps';`
...
importMapsPlugin(),
I added the import map with the path to my mock file:
Error while handling server request.
[Error: ENOENT: no such file or directory, stat '/test-mocks/prism.js'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/test-mocks/prism.js',
expose: true,
statusCode: 404,
status: 404
}
src/components/markdown/markdown.btest.ts:
🚧 Browser logs:
TypeError: Failed to fetch dynamically imported module: http://localhost:8080/src/components/markdown/markdown.btest.ts?wtr-session-id=qOWQX266tUzItfYfyr75g&wds-import-map=0&wds-import-map=0
❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information.
How can I debug this? What is the import map path relative to?
The text was updated successfully, but these errors were encountered:
I'm trying to mock
prismjs
because there seems to be an issue with the runner not being able to pick up its exports (code works fine so I know the exports exist).Original error:
I added import map plugin:
``
import { importMapsPlugin } from '@web/dev-server-import-maps';`
...
importMapsPlugin(),
testRunnerHtml: (testFramework) => `
<script type="importmap"> { "imports": { "prismjs": "./test-mocks/prism.js" } } </script> <script> window.process = {env: { NODE_ENV: "production" }} </script> <script type="module" src="${testFramework}"></script> `, ```folder structure is like:
Then I get this error:
How can I debug this? What is the import map path relative to?
The text was updated successfully, but these errors were encountered: