Skip to content

Commit 99d123a

Browse files
committed
add correct test
1 parent 7031c43 commit 99d123a

5 files changed

+19
-45
lines changed

src/testRunner/unittests/convertCompilerOptionsFromJson.ts

-45
Original file line numberDiff line numberDiff line change
@@ -436,51 +436,6 @@ namespace ts {
436436
);
437437
});
438438

439-
it("Correctly detects implicitly enabled strictNullChecks ", () => {
440-
assertCompilerOptions(
441-
{
442-
compilerOptions: {
443-
strict: true,
444-
strictPropertyInitialization: true
445-
}
446-
}, "tsconfig.json",
447-
{
448-
compilerOptions: {
449-
strict: true,
450-
strictPropertyInitialization: true
451-
},
452-
errors: []
453-
}
454-
);
455-
});
456-
457-
it("Checks dependency of strict options ", () => {
458-
assertCompilerOptions(
459-
{
460-
compilerOptions: {
461-
strict: true,
462-
strictNullChecks: false,
463-
strictPropertyInitialization: true
464-
}
465-
}, "tsconfig.json",
466-
{
467-
compilerOptions: {
468-
strict: true,
469-
strictNullChecks: false,
470-
strictPropertyInitialization: true
471-
},
472-
errors: [{
473-
file: undefined,
474-
start: 0,
475-
length: 0,
476-
messageText: "Option 'strictPropertyInitialization' cannot be specified without specifying option 'strictNullChecks'.",
477-
code: Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1.code,
478-
category: Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1.category
479-
}]
480-
}
481-
);
482-
});
483-
484439
// jsconfig.json
485440
it("Convert correctly format jsconfig.json to compiler-options ", () => {
486441
assertCompilerOptions(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//// [optionsStrictPropertyInitializationStrict.ts]
2+
var x;
3+
4+
5+
//// [optionsStrictPropertyInitializationStrict.js]
6+
"use strict";
7+
var x;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
=== tests/cases/compiler/optionsStrictPropertyInitializationStrict.ts ===
2+
var x;
3+
>x : Symbol(x, Decl(optionsStrictPropertyInitializationStrict.ts, 0, 3))
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
=== tests/cases/compiler/optionsStrictPropertyInitializationStrict.ts ===
2+
var x;
3+
>x : any
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// @strict: true
2+
// @strictPropertyInitialization: true
3+
4+
var x;

0 commit comments

Comments
 (0)