From c64f528f1514510f8fd98a5df6f857ba16242941 Mon Sep 17 00:00:00 2001 From: Jason Ian Green Date: Sat, 27 Apr 2024 14:10:54 +0100 Subject: [PATCH] chore: update typescript to 5.3.3 (#2406) * chore: update typescript to 5.3.3 * test: result should always be a Promise --- package.json | 2 +- spec/types/async-validate.spec.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d80c51a46..04dcf1e2e 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "rollup-plugin-terser": "^7.0.2", "ts-node": "^10.9.2", "tsify": "^5.0.4", - "typescript": "^4.9.5" + "typescript": "5.3.3" }, "collective": { "type": "opencollective", diff --git a/spec/types/async-validate.spec.ts b/spec/types/async-validate.spec.ts index 8e3f0588c..83a61417a 100644 --- a/spec/types/async-validate.spec.ts +++ b/spec/types/async-validate.spec.ts @@ -109,10 +109,10 @@ describe("$async validation and type guards", () => { const data: unknown = {foo: 1} let result: boolean | Promise if ((result = validate(data))) { - if (typeof result == "boolean") { - data.foo.should.equal(1) - } else { + if (result instanceof Promise) { await result.then((_data) => _data.foo.should.equal(1)) + } else { + should.fail() } } else { should.fail()