github.com/web-platform-tests/wpt.fyi@v0.0.0-20240530210107-70cf978996f1/webapp/README.md (about) 1 # wpt.fyi 2 3 ## Testing webapp/ 4 5 ### Prerequisites: 6 7 1. [Setting up your environment](https://github.com/web-platform-tests/wpt.fyi#setting-up-your-environment) 8 2. [Running locally](https://github.com/web-platform-tests/wpt.fyi#running-locally) 9 10 Once the above steps are completed, run the following commands from within `webapp/`: 11 12 ```sh 13 npm install 14 ``` 15 16 ### Test commands 17 18 webapp/ has both lint tests and tests based on 19 [web-component-test](https://www.npmjs.com/package/web-component-tester). There 20 are `npm` aliases for many of the common tasks, listed below. 21 22 - `npm test`: This will run the linting task followed by the web-component-tester task. 23 - `npm run lint`: This will run _only_ the linting task. 24 - `npm run lint-fix`: This will run the linting task with automatic lint fixing. 25 - `npm run wct`: This will run _only_ the web-component-tester task. 26 - `npm run wctp`: This will run the web-component-tester task with the `-p` flag 27 to leave the browser open after the tests have completed. 28 29 When using `npm run`, any additional flags or options will be passed to the 30 underlying command. For example, to run a specific test only on chrome: 31 32 - `npm run wct -l chrome path/to/test/test-file.html` 33 34 ### Running web_components_test 35 To run `web_components_test` in any platform, first start a Docker instance. 36 Once the instance is running, execute the following in another terminal: 37 ```sh 38 source util/commands.sh 39 wptd_exec make web_components_test 40 ```