mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
added possibility to provide extra TSC params in test runner (see Backgrid)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
1
backgrid/backgrid-tests.ts.tscparams
Normal file
1
backgrid/backgrid-tests.ts.tscparams
Normal file
@@ -0,0 +1 @@
|
||||
--target ES5
|
||||
Reference in New Issue
Block a user