diff --git a/tests/cases/conformance/types/typeRelationships/comparable/optionalProperties01.ts b/tests/cases/conformance/types/typeRelationships/comparable/optionalProperties01.ts new file mode 100644 index 00000000000..d4f04d78c80 --- /dev/null +++ b/tests/cases/conformance/types/typeRelationships/comparable/optionalProperties01.ts @@ -0,0 +1,11 @@ +// @strictNullChecks: true +// @declaration: true + +interface Foo { + required1: string; + required2: string; + optional?: string; +} + +const foo1 = { required1: "hello" } as Foo; +const foo2 = { required1: "hello", optional: "bar" } as Foo; diff --git a/tests/cases/conformance/types/typeRelationships/comparable/optionalProperties02.ts b/tests/cases/conformance/types/typeRelationships/comparable/optionalProperties02.ts new file mode 100644 index 00000000000..21f83276d44 --- /dev/null +++ b/tests/cases/conformance/types/typeRelationships/comparable/optionalProperties02.ts @@ -0,0 +1,9 @@ +// @strictNullChecks: true +// @declaration: true + +interface Foo { + a?: string; + b: string; +} + +{ a: undefined }; \ No newline at end of file