Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest testing with stencil-hooks implementation #9

Open
tannerjt opened this issue May 20, 2022 · 0 comments
Open

Jest testing with stencil-hooks implementation #9

tannerjt opened this issue May 20, 2022 · 0 comments

Comments

@tannerjt
Copy link

Attempting to run spec tests with components using stencil-hooks throws an error SyntaxError: Unexpected token 'export' because haunted library uses ESM export.

Although this isn't necessarily an issue directly related to stencil-hooks, I am curious if you've come across/solved this issue.

node_modules/haunted/lib/haunted.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export { html, render, component, createContext, virtual } from './lit-haunted.js';
                                                                                             ^^^^^^
SyntaxError: Unexpected token 'export'

  at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)
  at Object.<anonymous> (node_modules/@saasquatch/stencil-hooks/build/stencil-hooks.js:1:98)

General recommendation is to modify transformIgnorePatterns for testing config, but I wasn't able to resolve using that approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant