summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/type-consistency/spec/index.ts3
-rw-r--r--tests/type-consistency/spec/types.ts22
-rw-r--r--tests/type-consistency/tsconfig.json15
3 files changed, 39 insertions, 1 deletions
diff --git a/tests/type-consistency/spec/index.ts b/tests/type-consistency/spec/index.ts
index 9ef825f..4532493 100644
--- a/tests/type-consistency/spec/index.ts
+++ b/tests/type-consistency/spec/index.ts
@@ -1,4 +1,5 @@
import array from "./array";
import functions from "./function";
+import types from "./types";
-export default [array, functions];
+export default [array, functions, types];
diff --git a/tests/type-consistency/spec/types.ts b/tests/type-consistency/spec/types.ts
new file mode 100644
index 0000000..8bac271
--- /dev/null
+++ b/tests/type-consistency/spec/types.ts
@@ -0,0 +1,22 @@
+import path from "path";
+import { createTestHarness } from "../harness";
+
+export default createTestHarness({
+ harnessName: "Types",
+ generatedPath: path.join(__dirname, "..", "generated"),
+})
+ .createProgramTest({
+ name: "Handles number inputs",
+ program: "1,2,3",
+ expected: [1, 2, 3],
+ })
+ .createProgramTest({
+ name: "Handles string inputs",
+ program: `"hello", "world"`,
+ expected: ["hello", "world"],
+ })
+ .createProgramTest({
+ name: "Handles boolean inputs",
+ program: `true, false`,
+ expected: [true, false],
+ });
diff --git a/tests/type-consistency/tsconfig.json b/tests/type-consistency/tsconfig.json
new file mode 100644
index 0000000..e1421ab
--- /dev/null
+++ b/tests/type-consistency/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "include": ["generated/**/*.ts"],
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "nodenext",
+ "moduleResolution": "nodenext",
+ "lib": ["ES2022", "dom"],
+ "outDir": "dist",
+ "strict": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "declaration": true,
+ "declarationMap": true
+ }
+}