From 07eb44e483314528c96d6125a306167dbd308c7e Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Mon, 19 Jul 2021 11:56:14 +1000 Subject: fix(tsc): add .at() types manually to tsc (#11443) Fixes: #11441 --- cli/tests/unit/esnext_test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cli/tests/unit/esnext_test.ts (limited to 'cli/tests/unit') diff --git a/cli/tests/unit/esnext_test.ts b/cli/tests/unit/esnext_test.ts new file mode 100644 index 000000000..558c678bc --- /dev/null +++ b/cli/tests/unit/esnext_test.ts @@ -0,0 +1,12 @@ +// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +import { assertEquals, unitTest } from "./test_util.ts"; + +// TODO(@kitsonk) remove when we are no longer patching TypeScript to have +// these types available. + +unitTest(function typeCheckingEsNextArrayString() { + const a = "abcdef"; + assertEquals(a.at(-1), "f"); + const b = ["a", "b", "c", "d", "e", "f"]; + assertEquals(b.at(-1), "f"); +}); -- cgit v1.2.3