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
Importing "screen" giving me the error. #8
Comments
I see "node 12" but are you using node >= 12.17? This package ships ESModules (Which maybe I should revisit and ship a CJS equivalent for Jest) The other option is to add "shadow-dom-testing-library" to the "transformIgnorePatterns" for Jest so that it gets transformed.
|
My node version is v18.8.0. And I also added the following in my jest.config.ts file. But does not solve my problem. I also tried with your source code (from github). Showdow-dom does not works. I tried with the following code:
For my ionic element:
Which gives me the same error like normal testing-library. I posted the same problem in stackoverflow . |
I just released a CJS import path in v1.1.5 Let me know if upgrading fixes for you. |
Thanks, It solve the importing issue. But does not solve my problem.
The error I am getting is. ` TestingLibraryElementError: Found multiple elements with the role of: button
But Shadow dom is not working. same problem like normal library . |
If you have a reproduction I could look at that would help me immensely. I would also try not putting |
Reproduction also an issue. But that is not my main problem. My problem is I can not click or type in any ion-input Example UI component:
The code works for me : (screen is from your lib). Because it is not an Ionic component.
The code does not work:
The code gives me duplicate (by using shadow api)
I also tried the follow:
|
I fixed somethings regarding duplicate nodes. Let me know if it solves it for you in v1.1.8. |
Hello, I am using this library in my Ioinic Angular project.
When I import like below, this library gives me the error while running the test:
import { screen } from 'shadow-dom-testing-library';
The error looks like following:
`
Jest encountered an unexpected token
SyntaxError: Cannot use import statement outside a module
I have following libraries:
"@ionic/angular": "6.2.5", "@ionic/core": "6.2.5", "@angular/core": "~14.1.1", "shadow-dom-testing-library": "^1.1.4", "@testing-library/dom": "^8.17.1", jsdom@16.7.0, npm 6, node 12
The text was updated successfully, but these errors were encountered: