-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
html file doesnt handle paths correctly #68
Comments
- based on tape and testling - does not currently work on testling-ci - this is probably testling-ci's fault - does work quite nicely locally - tape-testing/testling#68
- based on tape and testling - does not currently work on testling-ci - this is probably testling-ci's fault - does work quite nicely locally - tape-testing/testling#68
- based on tape and testling - does not currently work on testling-ci - this is probably testling-ci's fault - does work quite nicely locally - tape-testing/testling#68
- based on tape and testling - does not currently work on testling-ci - this is probably testling-ci's fault - does work quite nicely locally - tape-testing/testling#68
In fact, I believe the issue is even worse than this! The local |
+1 I tried the |
Any updates on this? I am experiencing the same issue. |
One of my most favoritest things about testling is that it produces not only automated test results, but also you can view the tests locally in-browser. For libraries that interact with the DOM, it's great to also be able to visually verify your test cases.
Unfortunately, when you run testling with an html file (which makes it easier to test dom-based javascript), any externally loaded scripts are referenced from the root at which the
testling
command was run rather than where the file actually is. This means that if your tests are not at the root of your project, which they hardly ever are, you need a different set of paths for your tests to pass and for you to see the tests run locally. For example:If you have this folder structure:
...and your html file has these contents...
...assuming that
index.js
contains your tests, if you were toopen test/index.html
, you would see your tests run and all would be well. However, if you were to run$ testling
at the root of your project, assuming you have thepackage.json
set up correctly, the tests would not run. If you then change thesrc
of the script in your html file totest/index.js
however, the tests will run.Ideally, when testling ran using an html file, it would load any external paths based on the html file's base path rather than the base path that testling was run from 😀
I haven't looked into to testling's code much, but if you are busy and it would be easier for me to submit a PR, if you point me in the right direction I'd be happy to give this a shot!
The text was updated successfully, but these errors were encountered: