Skip to content

Commit

Permalink
Run API tests with 'strict' and 'exactOptionalProperties'. (microsoft…
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser authored Apr 5, 2022
1 parent a3c2218 commit c99afde
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/testRunner/unittests/publicApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ describe("unittests:: Public APIs", () => {
const fs = vfs.createFromFileSystem(Harness.IO, /*ignoreCase*/ false);
fs.linkSync(`${vfs.builtFolder}/${fileName}`, `${vfs.srcFolder}/${fileName}`);
const sys = new fakes.System(fs);
const host = new fakes.CompilerHost(sys);
const result = compiler.compileFiles(host, [`${vfs.srcFolder}/${fileName}`], {});
const options: ts.CompilerOptions = {
...ts.getDefaultCompilerOptions(),
strict: true,
exactOptionalPropertyTypes: true,
};
const host = new fakes.CompilerHost(sys, options);
const result = compiler.compileFiles(host, [`${vfs.srcFolder}/${fileName}`], options);
assert(!result.diagnostics || !result.diagnostics.length, Harness.Compiler.minimalDiagnosticsToString(result.diagnostics, /*pretty*/ true));
});
}
Expand Down

0 comments on commit c99afde

Please sign in to comment.