added possibility to provide extra TSC params in test runner (see Backgrid)

This commit is contained in:
gstamac
2013-08-23 20:52:29 +02:00
parent cb822a64a3
commit eb4eb383bc
3 changed files with 13 additions and 4 deletions

View File

@@ -583,7 +583,11 @@ var DefinitelyTyped;
function Tsc() {
}
Tsc.run = function (tsfile, callback) {
Exec.exec('node ./_infrastructure/tests/typescript/tsc.js --module commonjs ', [tsfile], function (ExecResult) {
var command = 'node ./_infrastructure/tests/typescript/tsc.js --module commonjs ';
if (IO.fileExists(tsfile + '.tscparams')) {
command += '@' + tsfile + '.tscparams';
}
Exec.exec(command, [tsfile], function (ExecResult) {
callback(ExecResult);
});
};
@@ -846,7 +850,7 @@ var DefinitelyTyped;
SyntaxChecking.prototype.run = function (it, file, len, maxLen, callback) {
var _this = this;
if (!endsWith(file.toUpperCase(), '-TESTS.TS') && file.indexOf('../_infrastructure') < 0) {
if (!endsWith(file.toUpperCase(), '-TESTS.TS') && endsWith(file.toUpperCase(), '.TS') && file.indexOf('../_infrastructure') < 0) {
new Test(file).run(function (o) {
var failed = false;

View File

@@ -28,7 +28,11 @@ module DefinitelyTyped {
class Tsc {
public static run(tsfile: string, callback: Function) {
Exec.exec('node ./_infrastructure/tests/typescript/tsc.js --module commonjs ', [tsfile], (ExecResult) => {
var command = 'node ./_infrastructure/tests/typescript/tsc.js --module commonjs ';
if (IO.fileExists(tsfile + '.tscparams')) {
command += '@' + tsfile + '.tscparams';
}
Exec.exec(command, [tsfile], (ExecResult) => {
callback(ExecResult);
});
}
@@ -292,7 +296,7 @@ module DefinitelyTyped {
}
private run(it, file, len, maxLen, callback: Function) {
if (!endsWith(file.toUpperCase(), '-TESTS.TS') && file.indexOf('../_infrastructure') < 0) {
if (!endsWith(file.toUpperCase(), '-TESTS.TS') && endsWith(file.toUpperCase(), '.TS') && file.indexOf('../_infrastructure') < 0) {
new Test(file).run((o) => {
var failed = false;

View File

@@ -0,0 +1 @@
--target ES5