Skip to content

Commit 0faf752

Browse files
committed
test: update test426 fixtures
Update test426 fixtures for source map tests. Refs: https://github.com/tc39/source-map-tests
1 parent 7674f98 commit 0faf752

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1113
-4
lines changed

β€Žtest/fixtures/test426/README.mdβ€Ž

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Source Map Tests
22

3-
This repository holds testing discussions and tests for the the Source Map debugging format. Specifically, we're looking to encourage discussion around:
3+
This repository holds discussions on testing and tests for the Source Map debugging format. Specifically, we're looking to encourage discussion around:
44

55
- Manual and automated testing strategies for Source Maps
6-
- Gathering a list of Soure Map generators and consumers
6+
- Gathering a list of Source Map generators and consumers
77
- General discussion around deviations between source maps
88

99
Open discussion happens in the [GitHub issues](https://github.com/source-map/source-map-tests/issues).
@@ -53,3 +53,8 @@ How to run in Chrome Devtools:
5353
* Run `git apply <path to .patch file>` in `devtools-frontend` repo
5454

5555
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)
56+
57+
#### Node.js
58+
59+
Follow the [running Node.js tests guide](https://github.com/nodejs/node/blob/main/BUILDING.md#running-tests) to build Node.js and run tests locally.
60+
Read more about running the source map tests at [here](https://github.com/nodejs/node/tree/main/test/test426).
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Decoding tests
2+
3+
This directory contains various source map files along with expectations to help implementations verify source map decoding.
4+
5+
Each source map `<file name>.map`, is accompanied by:
6+
7+
* a `<file name>.map.golden` file, containing a [Decoded Source Map Record](https://tc39.es/ecma426/#decoded-source-map-record) in JSON format
8+
* an optional `<file name>.map.error` file. It is present for source maps where the spec would ["optionally report an error"](https://tc39.es/ecma426/#sec-optional-errors). At the moment, the `<file name>.error` file only serves as a marker. But in the future it may be turned into a JSON with more information about the number and specifics of the expected errors.
9+
10+
## .golden format
11+
12+
The JSON format of the `.golden` files, attempts to follow the [Decoded Source Map Record](https://tc39.es/ecma426/#decoded-source-map-record) closely, but since the "Decoded Source Map Record" has cycles, we deviate slightly. The exact format is documented in [./source-map-record.d.ts](./source-map-record.d.ts).
13+
14+
## Proposals
15+
16+
Each source map proposal gets its own sub-directory. If a proposal adds new specification records or extends existing records, the sub-directory should contain a separate `<proposal>/<proposal>.d.ts` that describes the extended golden files. See [./scopes/scopes.d.ts](./scopes/scopes.d.ts) as an example. Once a proposal reaches stage 4, the `<proposal>/<proposal>.d.ts` file is merged into the [./source-map-record.d.ts](./source-map-record.d.ts).
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": 3,
3+
"file": "app.js",
4+
"sections": [{
5+
"offset": {
6+
"line": 0,
7+
"column": 0,
8+
},
9+
"map": {
10+
"version": 3,
11+
"file": "component1.js",
12+
"sources": [],
13+
"mappings": "",
14+
"debugId": "a938a92f-3074-41f7-bfdb-1038430a983c"
15+
}
16+
}, {
17+
"offset": {
18+
"line": 1,
19+
"column": 0,
20+
},
21+
"map": {
22+
"version": 3,
23+
"file": "component2.js",
24+
"sources": [],
25+
"mappings": "",
26+
"debugId": "8cf3d888-fc9e-457d-a999-6ffef384b736"
27+
}
28+
}]
29+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"file": "app.js",
3+
"sources": [],
4+
"mappings": [],
5+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"version": 3,
3+
"file": "app.js",
4+
"debugId": "1aad9d9e-2b50-454f-a5f2-0dd5e95c154c",
5+
"sections": [{
6+
"offset": {
7+
"line": 0,
8+
"column": 0,
9+
},
10+
"map": {
11+
"version": 3,
12+
"file": "component1.js",
13+
"sources": [],
14+
"mappings": "",
15+
"debugId": "a938a92f-3074-41f7-bfdb-1038430a983c"
16+
}
17+
}, {
18+
"offset": {
19+
"line": 1,
20+
"column": 0,
21+
},
22+
"map": {
23+
"version": 3,
24+
"file": "component2.js",
25+
"sources": [],
26+
"mappings": "",
27+
"debugId": "8cf3d888-fc9e-457d-a999-6ffef384b736"
28+
}
29+
}]
30+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"file": "app.js",
3+
"sources": [],
4+
"mappings": [],
5+
"debugId": "1aad9d9e-2b50-454f-a5f2-0dd5e95c154c"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
/// <reference path="../source-map-record.d.ts" />
3+
4+
interface SourceMapRecord {
5+
debugId: string|null;
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": 3,
3+
"sources": [],
4+
"mappings": "",
5+
"debugId": "1aad9d9e-2b50-454f-a5f2-0dd5e95c154c"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"file": null,
3+
"sources": [],
4+
"mappings": [],
5+
"debugId": "1aad9d9e-2b50-454f-a5f2-0dd5e95c154c"
6+
}

β€Žtest/fixtures/test426/decoding/debug-id/invalid-debug-id.errorβ€Ž

Whitespace-only changes.

0 commit comments

Comments
Β (0)