definition-tester
Advanced tools
Comparing version 0.4.0 to 0.5.0
{ | ||
"name": "definition-tester", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "DefinitelyTyped repository testing infrastructure", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -14,3 +14,3 @@ 'use strict'; | ||
File.prototype.toString = function () { | ||
return '[File ' + this.filePathWithName + ']'; | ||
return "[File " + this.filePathWithName + "]"; | ||
}; | ||
@@ -17,0 +17,0 @@ return File; |
@@ -31,3 +31,3 @@ 'use strict'; | ||
if (file.fullPath in this.fileMap) { | ||
throw new Error('cannot overwrite file: ' + file.fullPath); | ||
throw new Error("cannot overwrite file: " + file.fullPath); | ||
} | ||
@@ -142,3 +142,3 @@ this.fileMap[file.fullPath] = file; | ||
else { | ||
console.log(' not mapped? -> ' + ref); | ||
console.log(" not mapped? -> " + ref); | ||
} | ||
@@ -145,0 +145,0 @@ return memo; |
@@ -22,3 +22,3 @@ 'use strict'; | ||
output.push(''); | ||
output.push('> ' + file); | ||
output.push("> " + file); | ||
output.push(''); | ||
@@ -32,3 +32,3 @@ for (var i = 0; i < failures.length; i++) { | ||
var character = lineAndCharacter.character + 1; | ||
output.push('[' + ruleName + '] ' + failureString + ' at line ' + line + ', character ' + character + ':'); | ||
output.push("[" + ruleName + "] " + failureString + " at line " + line + ", character " + character + ":"); | ||
output.push(''); | ||
@@ -35,0 +35,0 @@ output.push(lines[lineAndCharacter.line].replace(/\t/g, ' ')); |
@@ -50,3 +50,3 @@ 'use strict'; | ||
if (!res) { | ||
testResult.stderr = 'bad result for ' + targetFile.filePathWithName; | ||
testResult.stderr = "bad result for " + targetFile.filePathWithName; | ||
testResult.exitCode = 1; | ||
@@ -53,0 +53,0 @@ } |
@@ -9,6 +9,6 @@ 'use strict'; | ||
if (testResult.attempts > 1) { | ||
this.print.out('\x1B[36m\x1B[1m' + testResult.attempts + '\x1B[0m'); | ||
this.print.out("\u001B[36m\u001B[1m" + testResult.attempts + "\u001B[0m"); | ||
} | ||
else { | ||
this.print.out('\x1B[36m\x1B[1m' + '.' + '\x1B[0m'); | ||
this.print.out("\u001B[36m\u001B[1m" + '.' + "\u001B[0m"); | ||
} | ||
@@ -15,0 +15,0 @@ this.index++; |
@@ -31,10 +31,10 @@ 'use strict'; | ||
this.out('=============================================================================\n'); | ||
this.out(' \x1B[36m\x1B[1mTypescript version:\x1B[0m ' + this.version + '\n'); | ||
this.out(' \x1B[36m\x1B[1mTypings :\x1B[0m ' + this.typings + '\n'); | ||
this.out(' \x1B[36m\x1B[1mTests :\x1B[0m ' + this.tests + '\n'); | ||
this.out(' \x1B[36m\x1B[1mTypeScript files :\x1B[0m ' + this.tsFiles + '\n'); | ||
this.out(' \x1B[36m\x1B[1mTotal Memory :\x1B[0m ' + totalMem + '\n'); | ||
this.out(' \x1B[36m\x1B[1mFree Memory :\x1B[0m ' + freemem + '\n'); | ||
this.out(' \x1B[36m\x1B[1mCores :\x1B[0m ' + os.cpus().length + '\n'); | ||
this.out(' \x1B[36m\x1B[1mConcurrent :\x1B[0m ' + options.concurrent + '\n'); | ||
this.out(" \u001B[36m\u001B[1mTypescript version:\u001B[0m " + this.version + "\n"); | ||
this.out(" \u001B[36m\u001B[1mTypings :\u001B[0m " + this.typings + "\n"); | ||
this.out(" \u001B[36m\u001B[1mTests :\u001B[0m " + this.tests + "\n"); | ||
this.out(" \u001B[36m\u001B[1mTypeScript files :\u001B[0m " + this.tsFiles + "\n"); | ||
this.out(" \u001B[36m\u001B[1mTotal Memory :\u001B[0m " + totalMem + "\n"); | ||
this.out(" \u001B[36m\u001B[1mFree Memory :\u001B[0m " + freemem + "\n"); | ||
this.out(" \u001B[36m\u001B[1mCores :\u001B[0m " + os.cpus().length + "\n"); | ||
this.out(" \u001B[36m\u001B[1mConcurrent :\u001B[0m " + options.concurrent + "\n"); | ||
}; | ||
@@ -63,3 +63,3 @@ Print.prototype.printSuiteHeader = function (title) { | ||
Print.prototype.printErrorsForFile = function (testResult) { | ||
this.out('----------------- For file:' + testResult.targetFile.filePathWithName); | ||
this.out("----------------- For file:" + testResult.targetFile.filePathWithName); | ||
if (testResult.stdout) { | ||
@@ -85,7 +85,7 @@ this.printBreak().out(this.trimTravis(testResult.stdout)).printBreak(); | ||
var arb = (total === 0) ? 0 : (current / total); | ||
this.out(' \x1B[36m\x1B[1mSuccessful :\x1B[0m \x1B[32m\x1B[1m' + (arb * 100).toFixed(2) + '% (' + current + '/' + total + ')\x1B[0m\n'); | ||
this.out(" \u001B[36m\u001B[1mSuccessful :\u001B[0m \u001B[32m\u001B[1m" + (arb * 100).toFixed(2) + "% (" + current + "/" + total + ")\u001B[0m\n"); | ||
}; | ||
Print.prototype.printFailedCount = function (current, total) { | ||
var arb = (total === 0) ? 0 : (current / total); | ||
this.out(' \x1B[36m\x1B[1mFailure :\x1B[0m \x1B[31m\x1B[1m' + (arb * 100).toFixed(2) + '% (' + current + '/' + total + ')\x1B[0m\n'); | ||
this.out(" \u001B[36m\u001B[1mFailure :\u001B[0m \u001B[31m\u001B[1m" + (arb * 100).toFixed(2) + "% (" + current + "/" + total + ")\u001B[0m\n"); | ||
}; | ||
@@ -99,3 +99,3 @@ Print.prototype.printTypingsWithoutTestsMessage = function () { | ||
Print.prototype.printElapsedTime = function (time, s) { | ||
this.out(' \x1B[36m\x1B[1mElapsed time :\x1B[0m ~' + time + ' (' + s + 's)\n'); | ||
this.out(" \u001B[36m\u001B[1mElapsed time :\u001B[0m ~" + time + " (" + s + "s)\n"); | ||
}; | ||
@@ -107,25 +107,25 @@ Print.prototype.printSuiteErrorCount = function (errorHeadline, current, total, warn) { | ||
if (warn) { | ||
this.out(': \x1B[31m\x1B[1m' + (arb * 100).toFixed(2) + '% (' + current + '/' + total + ')\x1B[0m\n'); | ||
this.out(": \u001B[31m\u001B[1m" + (arb * 100).toFixed(2) + "% (" + current + "/" + total + ")\u001B[0m\n"); | ||
} | ||
else { | ||
this.out(': \x1B[33m\x1B[1m' + (arb * 100).toFixed(2) + '% (' + current + '/' + total + ')\x1B[0m\n'); | ||
this.out(": \u001B[33m\u001B[1m" + (arb * 100).toFixed(2) + "% (" + current + "/" + total + ")\u001B[0m\n"); | ||
} | ||
}; | ||
Print.prototype.printSubHeader = function (file) { | ||
this.out(' \x1B[36m\x1B[1m' + file + '\x1B[0m\n'); | ||
this.out(" \u001B[36m\u001B[1m" + file + "\u001B[0m\n"); | ||
}; | ||
Print.prototype.printWarnCode = function (str) { | ||
this.out(' \x1B[31m\x1B[1m<' + str.toLowerCase().replace(/ +/g, '-') + '>\x1B[0m\n'); | ||
this.out(" \u001B[31m\u001B[1m<" + str.toLowerCase().replace(/ +/g, '-') + ">\u001B[0m\n"); | ||
}; | ||
Print.prototype.printLine = function (file) { | ||
this.out(file + '\n'); | ||
this.out(file + "\n"); | ||
}; | ||
Print.prototype.printElement = function (file) { | ||
this.out(' - ' + file + '\n'); | ||
this.out(" - " + file + "\n"); | ||
}; | ||
Print.prototype.printElement2 = function (file) { | ||
this.out(' - ' + file + '\n'); | ||
this.out(" - " + file + "\n"); | ||
}; | ||
Print.prototype.printTypingsWithoutTestName = function (file) { | ||
this.out(' - \x1B[33m\x1B[1m' + file + '\x1B[0m\n'); | ||
this.out(" - \u001B[33m\u001B[1m" + file + "\u001B[0m\n"); | ||
}; | ||
@@ -222,3 +222,3 @@ Print.prototype.printTypingsWithoutTest = function (withoutTestTypings) { | ||
var ref = index.getFile(src); | ||
_this.printLine('\x1B[31m\x1B[1m' + ref.filePathWithName + '\x1B[0m'); | ||
_this.printLine("\u001B[31m\u001B[1m" + ref.filePathWithName + "\u001B[0m"); | ||
refMap[src].forEach(function (file) { | ||
@@ -287,3 +287,3 @@ _this.printElement(file.filePathWithName); | ||
refMap[src].forEach(function (file) { | ||
_this.printLine(' - ' + file.filePathWithName); | ||
_this.printLine(" - " + file.filePathWithName); | ||
}); | ||
@@ -290,0 +290,0 @@ }); |
@@ -153,2 +153,4 @@ 'use strict'; | ||
}).first(); | ||
var typings; | ||
var withoutTestTypings; | ||
if (testEval) { | ||
@@ -160,3 +162,3 @@ var existsTestTypings = Lazy(testEval.testResults).map(function (testResult) { | ||
}, []); | ||
var typings = Lazy(files).map(function (file) { | ||
typings = Lazy(files).map(function (file) { | ||
return file.dir; | ||
@@ -166,3 +168,3 @@ }).reduce(function (a, b) { | ||
}, []); | ||
var withoutTestTypings = typings.filter(function (typing) { | ||
withoutTestTypings = typings.filter(function (typing) { | ||
return existsTestTypings.indexOf(typing) < 0; | ||
@@ -169,0 +171,0 @@ }); |
@@ -6,4 +6,3 @@ import * as Promise from 'bluebird'; | ||
static useJsx: RegExp; | ||
static useEs6: RegExp; | ||
static run(tsfile: string, options: ITscExecOptions): Promise<exec.ExecResult>; | ||
} |
@@ -28,11 +28,8 @@ 'use strict'; | ||
}).then(function (tsParamsExist) { | ||
var command = 'node ' + tscPath + ' --module commonjs '; | ||
var command = "node " + tscPath + " --target es6 --module commonjs --experimentalDecorators "; | ||
if (Tsc.useJsx.test(tsfile)) { | ||
command += '--jsx react '; | ||
} | ||
if (Tsc.useEs6.test(tsfile)) { | ||
command += '--target es6 '; | ||
} | ||
if (options.useTscParams && tsParamsExist) { | ||
command += '@' + tsfile + '.tscparams'; | ||
command += "@" + tsfile + ".tscparams"; | ||
} | ||
@@ -46,3 +43,2 @@ else if (options.checkNoImplicitAny) { | ||
Tsc.useJsx = /\.tsx$/i; | ||
Tsc.useEs6 = /\.es6\.tsx?$/i; | ||
return Tsc; | ||
@@ -49,0 +45,0 @@ })(); |
@@ -30,3 +30,3 @@ 'use strict'; | ||
return Promise.filter(files, function (file) { | ||
return util.fileExists(file.fullPath + '.tscparams'); | ||
return util.fileExists(file.fullPath + ".tscparams"); | ||
}); | ||
@@ -33,0 +33,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1
143372
1980