Ed Preston b9bc47ab19 Tests: Refinements and Additions (#25472) пре 3 година
..
src b9bc47ab19 Tests: Refinements and Additions (#25472) пре 3 година
utils 1ad78ef3dd Tests: Post Update Review (#25417) пре 3 година
README.md 973cc0453c Tests: Update Unit Test Readme (#25453) пре 3 година
UnitTests.html 138769ec01 Update UnitTests.html (#25407) пре 3 година
three.source.unit.js 16ac8654e4 Tests: Unit Tests for Core (#25402) пре 3 година

README.md

Setup

  • Execute npm install from the root folder

Run

You can run the unit tests in two environments:

  • Node.js: Execute npm run test-unit from the root folder
  • Browser: Execute npx servez -p 8080 --ssl (or run any other local web sever) from the root folder and access https://localhost:8080/test/unit/UnitTests.html in a web browser.

See How to run things locally for more information.

Notes

Some tests can only be run in a browser environment.

For browser tests, futher changes to the library will not be reflected until the page is refreshed.

When adding or updating tests, the cost common cause of test failure is forgetting to change QUnit.todo to QUnit.test when the test is ready.

Debugging

To debug a test, add debugger; to the test code. Then, run the test in a browser and open the developer tools. The test will stop at the debugger statement and you can inspect the code.

粤ICP备19079148号