-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Loading dependencies within JS tests #957
Comments
Thanks for the input! I'll try to understand how I can cover the example as an UMD plugin. |
@Vinai, we'd like to hear back from you. Do you need further assistance from the team on this issue? |
Thanks for the follow up @verklov! With the developer beta forum ans work I haven't had any time to dig further into this issue, but I plan on doing so when I have a little space. |
No problem @Vinai :-) We will be waiting for update from you. |
@Vinai, do you have any updates around this issue? |
Closed due to contributor's inactivity during last 2 weeks. @Vinai, if you have any other suggestions about improving Magento js testing, please, feel free to reopen this issue or create new one. |
The problem is custom jquery plugin extensions are not initialized.
On a page I'm loading jquery and a custom plugin jcanvas.
On the page on the frontend I'm the also loading a custom extension, and all works well.
Doing the same in a test however does not work as expected.
How can I ensure all requirements for a test are loaded?
Background to reproduce:
This is my requirejs-config.js from the example module
This is the little custom extension, its only purpose it to allow me to create a test for it
Here is the code from the template
The above far everything works fine when visiting a page in a browser.
The example test however doesn't succeed:
The first two assertions succeed. So jQuery and jCanvas must be loaded.
But the third assertion testing for the custom function fails,
this.canvas.drawAnotherLine
is undefined.Finally, here is my jsTestDriver.conf
The text was updated successfully, but these errors were encountered: