Skip to content

Commit e323826

Browse files
authored
Migrate JavaScript tests from Karma to the Jasmine framework (#12754)
1 parent 96b5117 commit e323826

File tree

8 files changed

+1305
-1691
lines changed

8 files changed

+1305
-1691
lines changed

.github/workflows/nodejs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ on:
66
- ".github/workflows/nodejs.yml"
77
- "sphinx/themes/**.js"
88
- "tests/js/**"
9-
- "karma.conf.js"
109
- "package.json"
1110
- "package-lock.json"
1211
pull_request:
1312
paths:
1413
- ".github/workflows/nodejs.yml"
1514
- "sphinx/themes/**.js"
1615
- "tests/js/**"
17-
- "karma.conf.js"
1816
- "package.json"
1917
- "package-lock.json"
2018

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ Bugs fixed
2828

2929
Testing
3030
-------
31+
32+
* #12141: Migrate from the deprecated ``karma`` JavaScript test framework to
33+
the actively-maintained ``jasmine`` framework. Test coverage is unaffected.
34+
Patch by James Addison.

doc/internals/contributing.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ Style and type checks can be run as follows:
174174
Unit tests
175175
~~~~~~~~~~
176176

177-
Sphinx is tested using pytest_ for Python code and Karma_ for JavaScript.
177+
Sphinx is tested using pytest_ for Python code and Jasmine_ for JavaScript.
178178

179179
.. _pytest: https://docs.pytest.org/en/latest/
180-
.. _Karma: https://karma-runner.github.io
180+
.. _Jasmine: https://jasmine.github.io/
181181

182182
To run Python unit tests, we recommend using :program:`tox`, which provides a number
183183
of targets and allows testing against multiple different Python environments:
@@ -216,13 +216,10 @@ To run JavaScript tests, use :program:`npm`:
216216
217217
.. tip::
218218

219-
:program:`karma` requires a Firefox binary to use as a test browser.
219+
:program:`jasmine` requires a Firefox binary to use as a test browser.
220220

221-
For Unix-based systems, you can specify the path to the Firefox binary using:
222-
223-
.. code-block:: shell
224-
225-
FIREFOX_BIN="/Applications/Firefox.app/Contents/MacOS/firefox" npm test
221+
On Unix systems, you can check the presence and location of the ``firefox``
222+
binary at the command-line by running ``command -v firefox``.
226223

227224
New unit tests should be included in the :file:`tests/` directory where necessary:
228225

karma.conf.js

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)