Skip to content

Commit 0e9fa86

Browse files
authored
Add TS usage tests (#6)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 27d2ffe commit 0e9fa86

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Person } from "./expected";
2+
3+
const person: Person = {
4+
name: "John Doe"
5+
};
6+
7+
const invalidPerson: Person = {
8+
// @ts-expect-error
9+
name: 123
10+
};

test/e2e/typescript/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ foreach(DIALECT_DIRECTORY ${TYPESCRIPT_DIALECT_DIRECTORIES})
2727
list(APPEND E2E_SCHEMAS "${CASE_DIRECTORY}/schema.json")
2828
add_test(NAME "e2e.typescript.tsc.${DIALECT_NAME}.${CASE_NAME}/expected.d.ts"
2929
COMMAND "${TSC_BIN}" --noEmit "${CASE_DIRECTORY}/expected.d.ts")
30+
31+
# TODO: Make this required for every case
32+
if(EXISTS "${CASE_DIRECTORY}/test.ts")
33+
add_test(NAME "e2e.typescript.tsc.${DIALECT_NAME}.${CASE_NAME}/test.ts"
34+
COMMAND "${TSC_BIN}" --noEmit "${CASE_DIRECTORY}/test.ts")
35+
endif()
3036
endif()
3137
endforeach()
3238
endif()

0 commit comments

Comments
 (0)