-
-
Notifications
You must be signed in to change notification settings - Fork 318
Open
Description
As in the title, snapshot testing is not working, it throws the following error
Failed to fetch dynamically imported module: data:text/package.json?wds-javascript;charset=utf-8,...
Test example:
it('should not throw',() => {
const el = await fixture(
html`<my-custom-element></my-custom-element>`
);
expect(el).shadowDom.to.equalSnapshot();
});
Digging a little bit, It seems that the framework tries to dynamically import the snapshot here, but that file is subject to various transformations, especially by transformModuleImportsPlugin, at the end the import specifier changes from data:text/javascript...
to data:text/package.json?wds-javascript...
.
I'm not sure though if there is something wrong in my configuration:
export default {
files: ['src/**/*.spec.ts'],
plugins: [
esbuildPlugin({ ts: true }),
importMapsPlugin({
inject: {
exclude: ['node_modules'],
importMap: {
imports: {
'/src/lib/api.ts': '/__mocks__/lib/api.ts',
},
},
},
}),
],
nodeResolve: true
};
1bberto, mauricioaraldi and dchege711
Metadata
Metadata
Assignees
Labels
No labels