summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/012_async.ts10
-rw-r--r--cli/tests/028_args.ts8
-rw-r--r--cli/tests/error_003_typescript.ts.out11
-rw-r--r--cli/tests/integration_tests.rs2
-rw-r--r--cli/tests/workers_round_robin_bench.ts20
-rw-r--r--cli/tests/workers_startup_bench.ts12
6 files changed, 22 insertions, 41 deletions
diff --git a/cli/tests/012_async.ts b/cli/tests/012_async.ts
index 1f1822c04..773272ca1 100644
--- a/cli/tests/012_async.ts
+++ b/cli/tests/012_async.ts
@@ -1,11 +1,9 @@
// Check that we can use the async keyword.
async function main(): Promise<void> {
- await new Promise(
- (resolve): void => {
- console.log("2");
- setTimeout(resolve, 100);
- }
- );
+ await new Promise((resolve): void => {
+ console.log("2");
+ setTimeout(resolve, 100);
+ });
console.log("3");
}
diff --git a/cli/tests/028_args.ts b/cli/tests/028_args.ts
index 51c5cb14b..f3604a830 100644
--- a/cli/tests/028_args.ts
+++ b/cli/tests/028_args.ts
@@ -1,5 +1,3 @@
-Deno.args.forEach(
- (arg): void => {
- console.log(arg);
- }
-);
+Deno.args.forEach((arg): void => {
+ console.log(arg);
+});
diff --git a/cli/tests/error_003_typescript.ts.out b/cli/tests/error_003_typescript.ts.out
index 0b1d94db4..ee93bc877 100644
--- a/cli/tests/error_003_typescript.ts.out
+++ b/cli/tests/error_003_typescript.ts.out
@@ -1,13 +1,6 @@
[WILDCARD]error TS2322: Type '{ a: { b: { c(): { d: number; }; }; }; }' is not assignable to type '{ a: { b: { c(): { d: string; }; }; }; }'.
- Types of property 'a' are incompatible.
- Type '{ b: { c(): { d: number; }; }; }' is not assignable to type '{ b: { c(): { d: string; }; }; }'.
- Types of property 'b' are incompatible.
- Type '{ c(): { d: number; }; }' is not assignable to type '{ c(): { d: string; }; }'.
- Types of property 'c' are incompatible.
- Type '() => { d: number; }' is not assignable to type '() => { d: string; }'.
- Type '{ d: number; }' is not assignable to type '{ d: string; }'.
- Types of property 'd' are incompatible.
- Type 'number' is not assignable to type 'string'.
+ The types of 'a.b.c().d' are incompatible between these types.
+ Type 'number' is not assignable to type 'string'.
[WILDCARD]/tests/error_003_typescript.ts:20:1
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index b8dab2de8..4bc52fc31 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -362,13 +362,11 @@ itest!(lock_check_ok {
http_server: true,
});
-/* TODO(ry) Re-enable this test. It is flaky and only fails occasionally.
itest!(lock_check_ok2 {
args: "run 019_media_types.ts --lock=lock_check_ok2.json",
output: "019_media_types.ts.out",
http_server: true,
});
-*/
itest!(lock_check_err {
args: "run --lock=lock_check_err.json http://127.0.0.1:4545/cli/tests/003_relative_import.ts",
diff --git a/cli/tests/workers_round_robin_bench.ts b/cli/tests/workers_round_robin_bench.ts
index 7c34e75e5..992ce38dc 100644
--- a/cli/tests/workers_round_robin_bench.ts
+++ b/cli/tests/workers_round_robin_bench.ts
@@ -15,11 +15,9 @@ export type Resolvable<T> = Promise<T> & ResolvableMethods<T>;
export function createResolvable<T>(): Resolvable<T> {
let methods: ResolvableMethods<T>;
- const promise = new Promise<T>(
- (resolve, reject): void => {
- methods = { resolve, reject };
- }
- );
+ const promise = new Promise<T>((resolve, reject): void => {
+ methods = { resolve, reject };
+ });
// TypeScript doesn't know that the Promise callback occurs synchronously
// therefore use of not null assertion (`!`)
return Object.assign(promise, methods!) as Resolvable<T>;
@@ -40,13 +38,11 @@ async function main(): Promise<void> {
const workers: Array<[Map<number, Resolvable<string>>, Worker]> = [];
for (let i = 1; i <= workerCount; ++i) {
const worker = new Worker("./subdir/bench_worker.ts");
- const promise = new Promise(
- (resolve): void => {
- worker.onmessage = (e): void => {
- if (e.data.cmdId === 0) resolve();
- };
- }
- );
+ const promise = new Promise((resolve): void => {
+ worker.onmessage = (e): void => {
+ if (e.data.cmdId === 0) resolve();
+ };
+ });
worker.postMessage({ cmdId: 0, action: 2 });
await promise;
workers.push([new Map(), worker]);
diff --git a/cli/tests/workers_startup_bench.ts b/cli/tests/workers_startup_bench.ts
index fbea4dc40..5d2c24b89 100644
--- a/cli/tests/workers_startup_bench.ts
+++ b/cli/tests/workers_startup_bench.ts
@@ -5,13 +5,11 @@ async function bench(): Promise<void> {
const workers: Worker[] = [];
for (let i = 1; i <= workerCount; ++i) {
const worker = new Worker("./subdir/bench_worker.ts");
- const promise = new Promise(
- (resolve): void => {
- worker.onmessage = (e): void => {
- if (e.data.cmdId === 0) resolve();
- };
- }
- );
+ const promise = new Promise((resolve): void => {
+ worker.onmessage = (e): void => {
+ if (e.data.cmdId === 0) resolve();
+ };
+ });
worker.postMessage({ cmdId: 0, action: 2 });
await promise;
workers.push(worker);