Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Karma to Web Test Runner #9242

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 4 additions & 22 deletions .github/workflows/main.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -101,17 +101,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- browser: Chrome
- browser: Firefox
- browser: FirefoxNoTouch
- browser: FirefoxRetina
- browser: Chrome
os: windows-latest
- browser: Chrome
os: macos-latest
- browser: SafariNative
os: macos-latest
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Restore setup
uses: actions/cache@v4
Expand All @@ -124,16 +114,8 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}

- name: Set up Google Chrome
uses: browser-actions/setup-chrome@v1
if: contains(matrix.browser, 'Chrome')

- name: Set up Firefox
uses: browser-actions/setup-firefox@v1
if: contains(matrix.browser, 'Firefox')

- name: Run tests on ${{ matrix.browser }}
run: npm test -- --browsers ${{ matrix.browser }} --single-run
- name: Run tests
run: npm test

publish-artifacts:
needs: setup
Expand Down
21 changes: 1 addition & 20 deletions CONTRIBUTING.md
Expand Up @@ -116,26 +116,7 @@ in a graphical browser. This requires regenerating the bundled files quickly.
In order to do so, run `npm run watch` or `yarn run watch`. This will keep
on rebuilding the bundles whenever any source file changes.

## Running the Tests

Before running the tests make sure that the source code has been built (as mentioned above). If you want to run the tests in the background while working on Leaflet it is recommended you run the build in `watch` mode. This way the tests will automatically re-run when changes to the source code are made.

To run the tests from the command line, ensure you have [Google Chrome](https://www.google.com/chrome/) installed and then run:

```
npm test
```

By default the tests will run in Google Chrome headlessly (without a UI), to run the tests in other browsers you can pass in the [`--browsers`](https://karma-runner.github.io/latest/config/configuration-file.html#browsers) flag.

```
npm test -- --browsers Firefox
```

For a list of available browsers see the documentation of the included launcher plugins:
- [`karma-chrome-launcher`](https://github.com/karma-runner/karma-chrome-launcher#available-browsers)
- [`karma-firefox-launcher`](https://github.com/karma-runner/karma-firefox-launcher#configuration)
- [`karma-safarinative-launcher`](https://github.com/muthu90ec/karma-safarinative-launcher#readme)
## TODO: Write new docs on how to run the tests.

## Improving Documentation

Expand Down