diff options
author | Kamil Ogórek <kamil.ogorek@gmail.com> | 2024-09-05 10:51:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 08:51:40 +0000 |
commit | 2c4d99a4586a8aa143feb8614e3b0d4de09dd190 (patch) | |
tree | 0c07ee12254da10d9710616be8cc98a32c0f35c7 /tests | |
parent | 49340b96f6b3603186e03f0102b99bc4a34a1b63 (diff) |
feat: include version number in all --json based outputs (#25335)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/specs/bench/json_output/pass.json.out | 1 | ||||
-rw-r--r-- | tests/specs/doc/json/__test__.jsonc | 4 | ||||
-rw-r--r-- | tests/specs/doc/json/json.js | 2 | ||||
-rw-r--r-- | tests/specs/doc/json/json.out | 28 | ||||
-rw-r--r-- | tests/specs/doc/json/types.d.ts | 2 | ||||
-rw-r--r-- | tests/specs/doc/lint_json_success/lint_success_json.out | 101 | ||||
-rw-r--r-- | tests/specs/info/multiple_redirects/main.out | 1 | ||||
-rw-r--r-- | tests/testdata/info/076_info_json_deps_order.out | 1 | ||||
-rw-r--r-- | tests/testdata/info/info_json.out | 1 | ||||
-rw-r--r-- | tests/testdata/info/info_json_location.out | 1 | ||||
-rw-r--r-- | tests/testdata/info/json_output/main.out | 1 | ||||
-rw-r--r-- | tests/testdata/lint/expected_from_stdin_json.out | 1 | ||||
-rw-r--r-- | tests/testdata/lint/expected_json.out | 1 | ||||
-rw-r--r-- | tests/testdata/lint/with_report_config_override.out | 1 | ||||
-rw-r--r-- | tests/testdata/npm/cjs_with_deps/main_info_json.out | 1 | ||||
-rw-r--r-- | tests/testdata/npm/info/chalk_json.out | 1 | ||||
-rw-r--r-- | tests/testdata/npm/peer_deps_with_copied_folders/main_info_json.out | 1 |
17 files changed, 100 insertions, 49 deletions
diff --git a/tests/specs/bench/json_output/pass.json.out b/tests/specs/bench/json_output/pass.json.out index 53259e758..7276158ac 100644 --- a/tests/specs/bench/json_output/pass.json.out +++ b/tests/specs/bench/json_output/pass.json.out @@ -1,5 +1,6 @@ Check file:///[WILDCARD]/pass.ts { + "version": 1, "runtime": "Deno/[WILDCARD]", "cpu": "[WILDCARD]", "benches": [ diff --git a/tests/specs/doc/json/__test__.jsonc b/tests/specs/doc/json/__test__.jsonc new file mode 100644 index 000000000..12005bc46 --- /dev/null +++ b/tests/specs/doc/json/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "doc --json json.js", + "output": "json.out" +} diff --git a/tests/specs/doc/json/json.js b/tests/specs/doc/json/json.js new file mode 100644 index 000000000..84d4ff4a0 --- /dev/null +++ b/tests/specs/doc/json/json.js @@ -0,0 +1,2 @@ +/// <reference types="./types.d.ts" /> +export const foo = "foo"; diff --git a/tests/specs/doc/json/json.out b/tests/specs/doc/json/json.out new file mode 100644 index 000000000..ae1b02596 --- /dev/null +++ b/tests/specs/doc/json/json.out @@ -0,0 +1,28 @@ +{ + "version": 1, + "nodes": [ + { + "name": "foo", + "isDefault": false, + "location": { + "filename": "file:///[WILDCARD]/types.d.ts", + "line": 2, + "col": 13, + "byteIndex": 39 + }, + "declarationKind": "export", + "jsDoc": { + "doc": "An exported value." + }, + "kind": "variable", + "variableDef": { + "tsType": { + "repr": "string", + "kind": "keyword", + "keyword": "string" + }, + "kind": "const" + } + } + ] +} diff --git a/tests/specs/doc/json/types.d.ts b/tests/specs/doc/json/types.d.ts new file mode 100644 index 000000000..ce39201e1 --- /dev/null +++ b/tests/specs/doc/json/types.d.ts @@ -0,0 +1,2 @@ +/** An exported value. */ +export const foo: string; diff --git a/tests/specs/doc/lint_json_success/lint_success_json.out b/tests/specs/doc/lint_json_success/lint_success_json.out index 19f04c6a8..1c82680f8 100644 --- a/tests/specs/doc/lint_json_success/lint_success_json.out +++ b/tests/specs/doc/lint_json_success/lint_success_json.out @@ -1,51 +1,54 @@ -[ - { - "name": "Test", - "isDefault": false, - "location": { - "filename": "file:///[WILDCARD]/lint_success.ts", - "line": 2, - "col": 0, - "byteIndex": 22 - }, - "declarationKind": "export", - "jsDoc": { - "doc": "My test class." - }, - "kind": "class", - "classDef": { - "isAbstract": false, - "constructors": [], - "properties": [ - { - "jsDoc": { - "doc": "My property." - }, - "tsType": { - "repr": "string", - "kind": "keyword", - "keyword": "string" - }, - "readonly": false, - "accessibility": null, - "optional": false, - "isAbstract": false, - "isStatic": false, - "name": "prop", - "location": { - "filename": "file:///[WILDCARD]/lint_success.ts", - "line": 4, - "col": 2, - "byteIndex": 66 +{ + "version": 1, + "nodes": [ + { + "name": "Test", + "isDefault": false, + "location": { + "filename": "file:///[WILDCARD]/lint_success.ts", + "line": 2, + "col": 0, + "byteIndex": 22 + }, + "declarationKind": "export", + "jsDoc": { + "doc": "My test class." + }, + "kind": "class", + "classDef": { + "isAbstract": false, + "constructors": [], + "properties": [ + { + "jsDoc": { + "doc": "My property." + }, + "tsType": { + "repr": "string", + "kind": "keyword", + "keyword": "string" + }, + "readonly": false, + "accessibility": null, + "optional": false, + "isAbstract": false, + "isStatic": false, + "name": "prop", + "location": { + "filename": "file:///[WILDCARD]/lint_success.ts", + "line": 4, + "col": 2, + "byteIndex": 66 + } } - } - ], - "indexSignatures": [], - "methods": [], - "extends": null, - "implements": [], - "typeParams": [], - "superTypeParams": [] + ], + "indexSignatures": [], + "methods": [], + "extends": null, + "implements": [], + "typeParams": [], + "superTypeParams": [] + } } - } -] + ] +} diff --git a/tests/specs/info/multiple_redirects/main.out b/tests/specs/info/multiple_redirects/main.out index bd18c1728..31123be77 100644 --- a/tests/specs/info/multiple_redirects/main.out +++ b/tests/specs/info/multiple_redirects/main.out @@ -47,5 +47,6 @@ Download http://localhost:4545/subdir/redirects/redirect1.js "http://localhost:4546/subdir/redirects/redirect1.js": "http://localhost:4545/subdir/redirects/redirect1.js", "http://localhost:4548/subdir/redirects/redirect1.js": "http://localhost:4546/subdir/redirects/redirect1.js" }, + "version": 1, "npmPackages": {} } diff --git a/tests/testdata/info/076_info_json_deps_order.out b/tests/testdata/info/076_info_json_deps_order.out index a1b15e00c..33d58da16 100644 --- a/tests/testdata/info/076_info_json_deps_order.out +++ b/tests/testdata/info/076_info_json_deps_order.out @@ -160,5 +160,6 @@ } ], "redirects": {}, + "version": 1, "npmPackages": {} } diff --git a/tests/testdata/info/info_json.out b/tests/testdata/info/info_json.out index 3215af742..607489ca3 100644 --- a/tests/testdata/info/info_json.out +++ b/tests/testdata/info/info_json.out @@ -1,4 +1,5 @@ { + "version": 1, "denoDir": "[WILDCARD]", "modulesCache": "[WILDCARD]deps", "npmCache": "[WILDCARD]npm", diff --git a/tests/testdata/info/info_json_location.out b/tests/testdata/info/info_json_location.out index 510fa7749..004bf03db 100644 --- a/tests/testdata/info/info_json_location.out +++ b/tests/testdata/info/info_json_location.out @@ -1,4 +1,5 @@ { + "version": 1, "denoDir": "[WILDCARD]", "modulesCache": "[WILDCARD]deps", "npmCache": "[WILDCARD]npm", diff --git a/tests/testdata/info/json_output/main.out b/tests/testdata/info/json_output/main.out index 5a89d5cab..43c4f7398 100644 --- a/tests/testdata/info/json_output/main.out +++ b/tests/testdata/info/json_output/main.out @@ -87,5 +87,6 @@ } ], "redirects": {}, + "version": 1, "npmPackages": {} } diff --git a/tests/testdata/lint/expected_from_stdin_json.out b/tests/testdata/lint/expected_from_stdin_json.out index 9e1188bcd..27b215b43 100644 --- a/tests/testdata/lint/expected_from_stdin_json.out +++ b/tests/testdata/lint/expected_from_stdin_json.out @@ -1,4 +1,5 @@ { + "version": 1, "diagnostics": [ { "filename": "[WILDCARD]$deno$stdin.ts", diff --git a/tests/testdata/lint/expected_json.out b/tests/testdata/lint/expected_json.out index 95c3d30ba..6712c891a 100644 --- a/tests/testdata/lint/expected_json.out +++ b/tests/testdata/lint/expected_json.out @@ -1,4 +1,5 @@ { + "version": 1, "diagnostics": [ { "filename": "[WILDCARD]file1.js", diff --git a/tests/testdata/lint/with_report_config_override.out b/tests/testdata/lint/with_report_config_override.out index 7ca748158..ad32e3123 100644 --- a/tests/testdata/lint/with_report_config_override.out +++ b/tests/testdata/lint/with_report_config_override.out @@ -1,4 +1,5 @@ { + "version": 1, "diagnostics": [ { "filename": "[WILDCARD]a.ts", diff --git a/tests/testdata/npm/cjs_with_deps/main_info_json.out b/tests/testdata/npm/cjs_with_deps/main_info_json.out index fd850b8a1..4d8c1a5be 100644 --- a/tests/testdata/npm/cjs_with_deps/main_info_json.out +++ b/tests/testdata/npm/cjs_with_deps/main_info_json.out @@ -53,6 +53,7 @@ "npm:chai@4.3": "npm:/chai@4.3.6", "npm:chalk@4": "npm:/chalk@4.1.2" }, + "version": 1, "npmPackages": { "ansi-styles@4.3.0": { "name": "ansi-styles", diff --git a/tests/testdata/npm/info/chalk_json.out b/tests/testdata/npm/info/chalk_json.out index bffed4ad4..d54155270 100644 --- a/tests/testdata/npm/info/chalk_json.out +++ b/tests/testdata/npm/info/chalk_json.out @@ -12,6 +12,7 @@ "redirects": { "npm:chalk@4": "npm:/chalk@4.1.2" }, + "version": 1, "npmPackages": { "ansi-styles@4.3.0": { "name": "ansi-styles", diff --git a/tests/testdata/npm/peer_deps_with_copied_folders/main_info_json.out b/tests/testdata/npm/peer_deps_with_copied_folders/main_info_json.out index a4306a6d5..48cb1f992 100644 --- a/tests/testdata/npm/peer_deps_with_copied_folders/main_info_json.out +++ b/tests/testdata/npm/peer_deps_with_copied_folders/main_info_json.out @@ -53,6 +53,7 @@ "npm:@denotest/peer-dep-test-child@1": "npm:/@denotest/peer-dep-test-child@1.0.0", "npm:@denotest/peer-dep-test-child@2": "npm:/@denotest/peer-dep-test-child@2.0.0" }, + "version": 1, "npmPackages": { "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { "name": "@denotest/peer-dep-test-child", |