Skip to content

Commit

Permalink
Update frontend tests documentation as part of #236 (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeandroNobrega authored Nov 19, 2024
1 parent 7c7abcf commit eb02798
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Frontend-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,20 @@ This list contains some resources that might help you while writing unit tests:

Running the frontend tests is as simple as running this command:

Docker:
```console
make run_tests.frontend
```

Python:
```console
python -m scripts.run_frontend_tests
```

These tests also run whenever you push changes to the frontend code.

**Tips for speeding things up**:
- When running the tests locally, you can add `--skip_install` after the first run to skip installing dependencies (and speed up the test).
- When running the tests locally, you can add `--skip_install` (included by default for the Docker command) after the first run to skip installing dependencies (and speed up the test).
- The file `combined-tests.spec.ts` has a require statement with a regex that matches and compiles all the specs files (irrespective of whether we want to run the spec files or not). To debug a specific unit test, you can replace the regex with the name of the specific file (make sure to escape all the hyphens (-), dots (.) and any other reserved regex characters). This will make the test run faster.

**Note: Typically, these tests take around 2.5 to 5 minutes (exclusive of the time taken for setting up ChromeHeadless) to run, assuming the machine has sufficient resources. If the total time taken is significantly longer than this, it may indicate an issue with the testing environment. In case such an issue is noticed or observed, please raise it on our [issue tracker](https://github.com/oppia/oppia/issues).**
Expand Down

0 comments on commit eb02798

Please sign in to comment.