2016-03-15 19:45:21 +01:00
|
|
|
/// <reference path="..\..\..\src\harness\harness.ts" />
|
|
|
|
/// <reference path="..\..\..\src\compiler\commandLineParser.ts" />
|
|
|
|
|
|
|
|
namespace ts {
|
|
|
|
describe('convertCompilerOptionsFromJson', () => {
|
2016-03-16 00:30:11 +01:00
|
|
|
function assertCompilerOptions(json: any, configFileName: string, expectedResult: { compilerOptions: CompilerOptions, errors: Diagnostic[] }) {
|
2016-03-20 04:59:32 +01:00
|
|
|
const { options: actualCompilerOptions, errors: actualErrors} = convertCompilerOptionsFromJson(json["compilerOptions"], "/apath/", configFileName);
|
2016-03-15 19:45:21 +01:00
|
|
|
|
|
|
|
const parsedCompilerOptions = JSON.stringify(actualCompilerOptions);
|
|
|
|
const expectedCompilerOptions = JSON.stringify(expectedResult.compilerOptions);
|
|
|
|
assert.equal(parsedCompilerOptions, expectedCompilerOptions);
|
|
|
|
|
|
|
|
const expectedErrors = expectedResult.errors;
|
|
|
|
assert.isTrue(expectedResult.errors.length === actualErrors.length, `Expected error: ${JSON.stringify(expectedResult.errors)}. Actual error: ${JSON.stringify(actualErrors)}.`);
|
|
|
|
for (let i = 0; i < actualErrors.length; ++i) {
|
|
|
|
const actualError = actualErrors[i];
|
|
|
|
const expectedError = expectedErrors[i];
|
2016-03-16 21:49:36 +01:00
|
|
|
assert.equal(actualError.code, expectedError.code);
|
|
|
|
assert.equal(actualError.category, expectedError.category);
|
|
|
|
assert.equal(actualError.messageText, expectedError.messageText);
|
2016-03-15 19:45:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-16 00:30:11 +01:00
|
|
|
// tsconfig.json tests
|
|
|
|
it("Convert correctly format tsconfig.json to compiler-options ", () => {
|
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
2016-03-28 23:20:54 +02:00
|
|
|
"lib": ["es5", "es2015.array", "es2015.symbol"]
|
2016-03-16 00:30:11 +01:00
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
2016-03-28 23:20:54 +02:00
|
|
|
lib: ["lib.es5.d.ts", "lib.es2015.array.d.ts", "lib.es2015.symbol.d.ts"]
|
2016-03-16 00:30:11 +01:00
|
|
|
},
|
|
|
|
errors: <Diagnostic[]>[]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Convert correctly format tsconfig.json with allowJs is false to compiler-options ", () => {
|
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
"allowJs": false,
|
2016-03-28 23:20:54 +02:00
|
|
|
"lib": ["es5", "es2015.array", "es2015.symbol"]
|
2016-03-16 00:30:11 +01:00
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
allowJs: false,
|
2016-03-28 23:20:54 +02:00
|
|
|
lib: ["lib.es5.d.ts", "lib.es2015.array.d.ts", "lib.es2015.symbol.d.ts"]
|
2016-03-16 00:30:11 +01:00
|
|
|
},
|
|
|
|
errors: <Diagnostic[]>[]
|
|
|
|
}
|
|
|
|
);
|
2016-03-15 19:45:21 +01:00
|
|
|
});
|
2016-03-16 21:49:36 +01:00
|
|
|
|
2016-03-28 23:20:54 +02:00
|
|
|
it("Convert incorrect option of jsx to compiler-options ", () => {
|
2016-03-16 21:49:36 +01:00
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
"jsx": ""
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Argument for '--jsx' option must be: 'preserve', 'react'",
|
|
|
|
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
|
|
|
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2016-03-28 23:20:54 +02:00
|
|
|
it("Convert incorrect option of module to compiler-options ", () => {
|
2016-03-16 21:49:36 +01:00
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015'",
|
|
|
|
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
|
|
|
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2016-03-28 23:20:54 +02:00
|
|
|
it("Convert incorrect option of newLine to compiler-options ", () => {
|
2016-03-16 21:49:36 +01:00
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"newLine": "",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Argument for '--newLine' option must be: 'crlf', 'lf'",
|
|
|
|
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
|
|
|
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2016-03-28 23:20:54 +02:00
|
|
|
it("Convert incorrect option of target to compiler-options ", () => {
|
2016-03-16 21:49:36 +01:00
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"target": "",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015'",
|
|
|
|
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
|
|
|
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2016-03-28 23:20:54 +02:00
|
|
|
it("Convert incorrect option of module-resolution to compiler-options ", () => {
|
2016-03-16 21:49:36 +01:00
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"moduleResolution": "",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Argument for '--moduleResolution' option must be: 'node', 'classic'",
|
|
|
|
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
|
|
|
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2016-03-28 23:20:54 +02:00
|
|
|
it("Convert incorrect option of libs to compiler-options ", () => {
|
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
"lib": ["es5", "es2015.array", "incorrectLib"]
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
lib: ["lib.es5.d.ts", "lib.es2015.array.d.ts"]
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'dom', 'webworker', 'scripthost', 'es2015.array', 'es2015.collection', 'es2015.generator', 'es2015.function', 'es2015.iterable', 'es2015.math', 'es2015.number', 'es2015.object', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.regexp', 'es2015.string', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include'",
|
|
|
|
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
|
|
|
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Convert empty string option of libs to compiler-options ", () => {
|
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
"lib": ["es5", ""]
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
lib: ["lib.es5.d.ts"]
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'dom', 'webworker', 'scripthost', 'es2015.array', 'es2015.collection', 'es2015.generator', 'es2015.function', 'es2015.iterable', 'es2015.math', 'es2015.number', 'es2015.object', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.regexp', 'es2015.string', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include'",
|
|
|
|
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
|
|
|
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Convert empty string option of libs to compiler-options ", () => {
|
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
"lib": [""]
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
lib: []
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'dom', 'webworker', 'scripthost', 'es2015.array', 'es2015.collection', 'es2015.generator', 'es2015.function', 'es2015.iterable', 'es2015.math', 'es2015.number', 'es2015.object', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.regexp', 'es2015.string', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include'",
|
|
|
|
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
|
|
|
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Convert trailing-whitespace string option of libs to compiler-options ", () => {
|
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
"lib": [" "]
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
lib: []
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'dom', 'webworker', 'scripthost', 'es2015.array', 'es2015.collection', 'es2015.generator', 'es2015.function', 'es2015.iterable', 'es2015.math', 'es2015.number', 'es2015.object', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.regexp', 'es2015.string', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include'",
|
|
|
|
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
|
|
|
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Convert empty option of libs to compiler-options ", () => {
|
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
|
|
|
"lib": []
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
|
|
|
lib: []
|
|
|
|
},
|
|
|
|
errors: []
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2016-03-16 21:49:36 +01:00
|
|
|
it("Convert incorrectly format tsconfig.json to compiler-options ", () => {
|
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"modu": "commonjs",
|
|
|
|
}
|
|
|
|
}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: {},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
|
|
|
messageText: "Unknown compiler option 'modu'.",
|
|
|
|
code: Diagnostics.Unknown_compiler_option_0.code,
|
|
|
|
category: Diagnostics.Unknown_compiler_option_0.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Convert default tsconfig.json to compiler-options ", () => {
|
|
|
|
assertCompilerOptions({}, "tsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: {} as CompilerOptions,
|
2016-03-16 00:30:11 +01:00
|
|
|
errors: <Diagnostic[]>[]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2016-03-16 21:49:36 +01:00
|
|
|
// jsconfig.json
|
|
|
|
it("Convert correctly format jsconfig.json to compiler-options ", () => {
|
2016-03-16 00:30:11 +01:00
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
2016-03-28 23:20:54 +02:00
|
|
|
"lib": ["es5", "es2015.array", "es2015.symbol"]
|
2016-03-16 00:30:11 +01:00
|
|
|
}
|
|
|
|
}, "jsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
2016-03-16 21:49:36 +01:00
|
|
|
allowJs: true,
|
2016-03-16 00:30:11 +01:00
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
2016-03-28 23:20:54 +02:00
|
|
|
lib: ["lib.es5.d.ts", "lib.es2015.array.d.ts", "lib.es2015.symbol.d.ts"]
|
2016-03-16 00:30:11 +01:00
|
|
|
},
|
|
|
|
errors: <Diagnostic[]>[]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2016-03-16 21:49:36 +01:00
|
|
|
it("Convert correctly format jsconfig.json with allowJs is false to compiler-options ", () => {
|
2016-03-16 00:30:11 +01:00
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"module": "commonjs",
|
|
|
|
"target": "es5",
|
|
|
|
"noImplicitAny": false,
|
|
|
|
"sourceMap": false,
|
2016-03-16 21:49:36 +01:00
|
|
|
"allowJs": false,
|
2016-03-28 23:20:54 +02:00
|
|
|
"lib": ["es5", "es2015.array", "es2015.symbol"]
|
2016-03-16 00:30:11 +01:00
|
|
|
}
|
|
|
|
}, "jsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions: <CompilerOptions>{
|
2016-03-16 21:49:36 +01:00
|
|
|
allowJs: false,
|
2016-03-16 00:30:11 +01:00
|
|
|
module: ModuleKind.CommonJS,
|
|
|
|
target: ScriptTarget.ES5,
|
|
|
|
noImplicitAny: false,
|
|
|
|
sourceMap: false,
|
2016-03-28 23:20:54 +02:00
|
|
|
lib: ["lib.es5.d.ts", "lib.es2015.array.d.ts", "lib.es2015.symbol.d.ts"]
|
2016-03-16 00:30:11 +01:00
|
|
|
},
|
2016-03-16 21:49:36 +01:00
|
|
|
errors: <Diagnostic[]>[]
|
2016-03-16 00:30:11 +01:00
|
|
|
}
|
|
|
|
);
|
2016-03-16 21:49:36 +01:00
|
|
|
});
|
2016-03-16 00:30:11 +01:00
|
|
|
|
|
|
|
it("Convert incorrectly format jsconfig.json to compiler-options ", () => {
|
|
|
|
assertCompilerOptions(
|
|
|
|
{
|
|
|
|
"compilerOptions": {
|
|
|
|
"modu": "commonjs",
|
|
|
|
}
|
|
|
|
}, "jsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions:
|
|
|
|
{
|
|
|
|
allowJs: true
|
|
|
|
},
|
|
|
|
errors: [{
|
|
|
|
file: undefined,
|
|
|
|
start: 0,
|
|
|
|
length: 0,
|
2016-03-16 21:49:36 +01:00
|
|
|
messageText: "Unknown compiler option 'modu'.",
|
2016-03-16 00:30:11 +01:00
|
|
|
code: Diagnostics.Unknown_compiler_option_0.code,
|
|
|
|
category: Diagnostics.Unknown_compiler_option_0.category
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Convert default jsconfig.json to compiler-options ", () => {
|
|
|
|
assertCompilerOptions({}, "jsconfig.json",
|
|
|
|
{
|
|
|
|
compilerOptions:
|
|
|
|
{
|
|
|
|
allowJs: true
|
|
|
|
},
|
|
|
|
errors: <Diagnostic[]>[]
|
|
|
|
}
|
|
|
|
);
|
2016-03-15 19:45:21 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|