1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

chore(npm): fix types tests (#16882)

This commit is contained in:
David Sherret 2022-12-01 12:26:33 -05:00 committed by GitHub
parent fafb3eebaf
commit 1615852025
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 12 deletions

View file

@ -320,27 +320,27 @@ mod npm {
}); });
itest!(types_entry_value_not_exists { itest!(types_entry_value_not_exists {
args: "run --check=all npm/types_entry_value_not_exists/main.ts", args: "check --remote npm/types_entry_value_not_exists/main.ts",
output: "npm/types_entry_value_not_exists/main.out", output: "npm/types_entry_value_not_exists/main.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
exit_code: 0, exit_code: 1,
}); });
itest!(types_exports_import_types { itest!(types_exports_import_types {
args: "run --check=all npm/types_exports_import_types/main.ts", args: "check --remote npm/types_exports_import_types/main.ts",
output: "npm/types_exports_import_types/main.out", output: "npm/types_exports_import_types/main.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
exit_code: 0, exit_code: 1,
}); });
itest!(types_no_types_entry { itest!(types_no_types_entry {
args: "run --check=all npm/types_no_types_entry/main.ts", args: "check --remote npm/types_no_types_entry/main.ts",
output: "npm/types_no_types_entry/main.out", output: "npm/types_no_types_entry/main.out",
envs: env_vars_for_npm_tests(), envs: env_vars_for_npm_tests(),
http_server: true, http_server: true,
exit_code: 0, exit_code: 1,
}); });
itest!(typescript_file_in_package { itest!(typescript_file_in_package {

View file

@ -1,4 +1,7 @@
Download http://localhost:4545/npm/registry/@denotest/types-entry-value-not-exists Download http://localhost:4545/npm/registry/@denotest/types-entry-value-not-exists
Download http://localhost:4545/npm/registry/@denotest/types-entry-value-not-exists/1.0.0.tgz Download http://localhost:4545/npm/registry/@denotest/types-entry-value-not-exists/1.0.0.tgz
Check file://[WILDCARD]/types_entry_value_not_exists/main.ts Check file://[WILDCARD]/types_entry_value_not_exists/main.ts
5 error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
const result: string = getValue();
~~~~~~
at file:///[WILDCARD]/main.ts:4:7

View file

@ -1,4 +1,5 @@
import { getValue } from "npm:@denotest/types-entry-value-not-exists"; import { getValue } from "npm:@denotest/types-entry-value-not-exists";
const result: 5 = getValue(); // should error here
const result: string = getValue();
console.log(result); console.log(result);

View file

@ -1,4 +1,7 @@
Download http://localhost:4545/npm/registry/@denotest/types-exports-import-types Download http://localhost:4545/npm/registry/@denotest/types-exports-import-types
Download http://localhost:4545/npm/registry/@denotest/types-exports-import-types/1.0.0.tgz Download http://localhost:4545/npm/registry/@denotest/types-exports-import-types/1.0.0.tgz
Check file://[WILDCARD]/types_exports_import_types/main.ts Check file://[WILDCARD]/types_exports_import_types/main.ts
5 error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
const result: string = getValue();
~~~~~~
at file:///[WILDCARD]/main.ts:4:7

View file

@ -1,4 +1,5 @@
import { getValue } from "npm:@denotest/types-exports-import-types"; import { getValue } from "npm:@denotest/types-exports-import-types";
const result: 5 = getValue(); // should error here
const result: string = getValue();
console.log(result); console.log(result);

View file

@ -1,4 +1,7 @@
Download http://localhost:4545/npm/registry/@denotest/types-no-types-entry Download http://localhost:4545/npm/registry/@denotest/types-no-types-entry
Download http://localhost:4545/npm/registry/@denotest/types-no-types-entry/1.0.0.tgz Download http://localhost:4545/npm/registry/@denotest/types-no-types-entry/1.0.0.tgz
Check file://[WILDCARD]/types_no_types_entry/main.ts Check file://[WILDCARD]/types_no_types_entry/main.ts
5 error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'.
const result: string = getValue();
~~~~~~
at file:///[WILDCARD]/main.ts:4:7

View file

@ -1,4 +1,5 @@
import { getValue } from "npm:@denotest/types-no-types-entry"; import { getValue } from "npm:@denotest/types-no-types-entry";
const result: 5 = getValue(); // should error here
const result: string = getValue();
console.log(result); console.log(result);