From 95d7b43e652b3bfea2ff033733f5ed2e181f8c23 Mon Sep 17 00:00:00 2001 From: MohammadSu1 Date: Fri, 8 Nov 2024 19:11:20 +0200 Subject: [PATCH] Adding a test for the .mts and .cts --- tests/specs/fmt_errors/__test__.jsonc | 4 ++++ tests/specs/fmt_errors/a.cts | 4 ++++ tests/specs/fmt_errors/main.mts | 3 +++ 3 files changed, 11 insertions(+) create mode 100644 tests/specs/fmt_errors/__test__.jsonc create mode 100644 tests/specs/fmt_errors/a.cts create mode 100644 tests/specs/fmt_errors/main.mts diff --git a/tests/specs/fmt_errors/__test__.jsonc b/tests/specs/fmt_errors/__test__.jsonc new file mode 100644 index 0000000000..05edd48cd1 --- /dev/null +++ b/tests/specs/fmt_errors/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read main.mts", + "output": "3" +} \ No newline at end of file diff --git a/tests/specs/fmt_errors/a.cts b/tests/specs/fmt_errors/a.cts new file mode 100644 index 0000000000..5a92c93ea6 --- /dev/null +++ b/tests/specs/fmt_errors/a.cts @@ -0,0 +1,4 @@ +export function add(num1, num2) { + const result = num1 + num2; + console.log(result); +} diff --git a/tests/specs/fmt_errors/main.mts b/tests/specs/fmt_errors/main.mts new file mode 100644 index 0000000000..771bacf997 --- /dev/null +++ b/tests/specs/fmt_errors/main.mts @@ -0,0 +1,3 @@ +import * as a from "./a.cts"; + +console.log(a.add(1,2)); \ No newline at end of file