From 8442ed67628e5d51e02b876d0f27479f9215bf0a Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Sat, 8 Nov 2025 17:30:19 -0800 Subject: add more tests, fix issues, add support for booleans --- tests/type-consistency/spec/index.ts | 3 ++- tests/type-consistency/spec/types.ts | 22 ++++++++++++++++++++++ tests/type-consistency/tsconfig.json | 15 +++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 tests/type-consistency/spec/types.ts create mode 100644 tests/type-consistency/tsconfig.json (limited to 'tests') 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 + } +} -- cgit v1.2.3-70-g09d2