add correct test
This commit is contained in:
parent
7031c43978
commit
99d123a72d
|
@ -436,51 +436,6 @@ namespace ts {
|
|||
);
|
||||
});
|
||||
|
||||
it("Correctly detects implicitly enabled strictNullChecks ", () => {
|
||||
assertCompilerOptions(
|
||||
{
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
strictPropertyInitialization: true
|
||||
}
|
||||
}, "tsconfig.json",
|
||||
{
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
strictPropertyInitialization: true
|
||||
},
|
||||
errors: []
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it("Checks dependency of strict options ", () => {
|
||||
assertCompilerOptions(
|
||||
{
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
strictNullChecks: false,
|
||||
strictPropertyInitialization: true
|
||||
}
|
||||
}, "tsconfig.json",
|
||||
{
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
strictNullChecks: false,
|
||||
strictPropertyInitialization: true
|
||||
},
|
||||
errors: [{
|
||||
file: undefined,
|
||||
start: 0,
|
||||
length: 0,
|
||||
messageText: "Option 'strictPropertyInitialization' cannot be specified without specifying option 'strictNullChecks'.",
|
||||
code: Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1.code,
|
||||
category: Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1.category
|
||||
}]
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// jsconfig.json
|
||||
it("Convert correctly format jsconfig.json to compiler-options ", () => {
|
||||
assertCompilerOptions(
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
//// [optionsStrictPropertyInitializationStrict.ts]
|
||||
var x;
|
||||
|
||||
|
||||
//// [optionsStrictPropertyInitializationStrict.js]
|
||||
"use strict";
|
||||
var x;
|
|
@ -0,0 +1,4 @@
|
|||
=== tests/cases/compiler/optionsStrictPropertyInitializationStrict.ts ===
|
||||
var x;
|
||||
>x : Symbol(x, Decl(optionsStrictPropertyInitializationStrict.ts, 0, 3))
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
=== tests/cases/compiler/optionsStrictPropertyInitializationStrict.ts ===
|
||||
var x;
|
||||
>x : any
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
// @strict: true
|
||||
// @strictPropertyInitialization: true
|
||||
|
||||
var x;
|
Loading…
Reference in a new issue