|
| 1 | +# Source Map Tests |
| 2 | + |
| 3 | +This repository holds testing discussions and tests for the the Source Map debugging format. Specifically, we're looking to encourage discussion around: |
| 4 | + |
| 5 | +- Manual and automated testing strategies for Source Maps |
| 6 | +- Gathering a list of Soure Map generators and consumers |
| 7 | +- General discussion around deviations between source maps |
| 8 | + |
| 9 | +Open discussion happens in the [GitHub issues](https://github.com/source-map/source-map-tests/issues). |
| 10 | + |
| 11 | +Source Map spec: |
| 12 | + * Repo: https://github.com/tc39/source-map |
| 13 | + * Rendered spec: https://tc39.es/source-map/ |
| 14 | + |
| 15 | +## Test cases |
| 16 | + |
| 17 | +This repo also contains cross-implementation test cases that can be run in test |
| 18 | +suites for source map implementations, including browser devtool and library test |
| 19 | +suites. |
| 20 | + |
| 21 | +### Running the tests |
| 22 | + |
| 23 | +#### Tools |
| 24 | + |
| 25 | +[Source map validator](https://github.com/jkup/source-map-validator): |
| 26 | + * The tests are included in the validator test suite [here](https://github.com/jkup/source-map-validator/blob/main/src/spec-tests.test.ts). You can run them with `npm test`. |
| 27 | + |
| 28 | +#### Browsers |
| 29 | + |
| 30 | +The tests for Firefox are in the Mozilla [source-map](https://github.com/mozilla/source-map) library: |
| 31 | + * The upstream repo has a [test file](https://github.com/mozilla/source-map/blob/master/test/test-spec-tests.js) for running the spec tests from this repo. They can be run with `npm test`. |
| 32 | + |
| 33 | +How to run in WebKit: |
| 34 | + * Check out [WebKit](https://github.com/WebKit/WebKit/) |
| 35 | + * `cd` to the checked out WebKit directory. |
| 36 | + * Run `git am <this-repo>/webkit/0001-Add-harness-for-source-maps-spec-tests.patch` |
| 37 | + * Run `Tools/Scripts/build-webkit` (depending on the platform you may need to pass `--gtk` or other flags) |
| 38 | + * Run `Tools/Scripts/run-webkit-tests LayoutTests/inspector/model/source-map-spec.html` (again, you may need `--gtk` on Linux) |
| 39 | + |
| 40 | +How to run in Chrome Devtools: |
| 41 | +1. Setup: |
| 42 | + * Install depot_tools following this [depot_tools guide](https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up) |
| 43 | + * Check out [Chrome Devtools](https://chromium.googlesource.com/devtools/devtools-frontend): |
| 44 | + * Run `gclient config https://chromium.googlesource.com/devtools/devtools-frontend --unmanaged` |
| 45 | + * Run `cd devtools-frontend` |
| 46 | + * Run `gclient sync` |
| 47 | + * Run `gn gen out/Default` |
| 48 | +2. Build: |
| 49 | + * Run `autoninja -C out/Default` |
| 50 | +3. Test: |
| 51 | + * Run `npm run auto-unittest` |
| 52 | +4. Apply patches from this repo: |
| 53 | + * Run `git apply <path to .patch file>` in `devtools-frontend` repo |
| 54 | + |
| 55 | +More information about running Chrome Devtools without building Chromium can be found [here](https://chromium.googlesource.com/devtools/devtools-frontend/+/refs/heads/chromium/3965/README.md) |
0 commit comments