Add default target in compiler option of project runner

This commit is contained in:
Yui T 2015-01-06 18:00:59 -08:00
parent 4e5a3ae695
commit 436baafc72
3 changed files with 7 additions and 2 deletions

View File

@ -164,7 +164,8 @@ class ProjectRunner extends RunnerBase {
mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? ts.sys.resolvePath(testCase.mapRoot) : testCase.mapRoot,
sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? ts.sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot,
module: moduleKind,
noResolve: testCase.noResolve
noResolve: testCase.noResolve,
target: ts.ScriptTarget.ES6
};
}
@ -186,7 +187,7 @@ class ProjectRunner extends RunnerBase {
function createCompilerHost(): ts.CompilerHost {
return {
getSourceFile,
getDefaultLibFilename: options => options.target === ts.ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts",
getDefaultLibFilename: options => Harness.Compiler.defaultLibFileName,
writeFile,
getCurrentDirectory,
getCanonicalFileName: Harness.Compiler.getCanonicalFileName,

View File

@ -1,3 +1,4 @@
error TS2318: Cannot find global type 'TemplateStringsArray'.
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'Object'.
@ -9,6 +10,7 @@ error TS2318: Cannot find global type 'Array'.
test.ts(3,8): error TS2304: Cannot find name 'Array'.
!!! error TS2318: Cannot find global type 'TemplateStringsArray'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'Object'.

View File

@ -1,3 +1,4 @@
error TS2318: Cannot find global type 'TemplateStringsArray'.
error TS2318: Cannot find global type 'String'.
error TS2318: Cannot find global type 'RegExp'.
error TS2318: Cannot find global type 'Object'.
@ -9,6 +10,7 @@ error TS2318: Cannot find global type 'Array'.
test.ts(3,8): error TS2304: Cannot find name 'Array'.
!!! error TS2318: Cannot find global type 'TemplateStringsArray'.
!!! error TS2318: Cannot find global type 'String'.
!!! error TS2318: Cannot find global type 'RegExp'.
!!! error TS2318: Cannot find global type 'Object'.