-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Update Unit Test Readme (#25453)
* Update Unit Test Readme Update unit test readme to reflect changes since #25380 Avoid building the library and flagging the files as changed (tests run off source) Add notes to help people running unit tests. ColorManagement.enabled is false by default. Tune logging so only genuine test failure messages are displayed. * Update ColorManagement.tests.js Minimize the console messages captured.
- Loading branch information
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
## Setup | ||
|
||
- Execute `npm i --prefix test` from root folder | ||
- 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 root folder | ||
- Browser: Execute `npm start` (or run any other local web sever) from root folder and access `http://localhost:8080/test/unit/UnitTests.html` on web browser. (See [How to run things locally](https://threejs.org/docs/#manual/introduction/How-to-run-things-locally)) | ||
- 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](https://threejs.org/docs/#manual/introduction/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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters