Merge pull request #921 from gstamac/fix_Travis_CI_tests

Fix travis ci tests
This commit is contained in:
Boris Yankov
2013-08-24 12:52:14 -07:00
16 changed files with 228 additions and 211 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

View File

@@ -1,6 +1,6 @@
/// <reference path="cheerio.d.ts" />
import cheerio = module("cheerio");
import cheerio = require("cheerio");
var $ = cheerio.load("<html></html>");
var $el = $('selector');

View File

@@ -1089,7 +1089,7 @@ function test_datepicker() {
buttonImage: "images/calendar.gif",
buttonImageOnly: true
});
$.datepicker.setDefaults($.datepicker.regional[""]);
$.datepicker.setDefaults($.datepicker.regional[<string>""]);
$("#datepicker").datepicker($.datepicker.regional["fr"]);
$("#locale").change(function () {
$("#datepicker").datepicker("option",
@@ -1137,7 +1137,7 @@ function test_datepicker() {
$(".selector").datepicker({ dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"] });
$(".selector").datepicker({ dayNamesMin: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"] });
$.datepicker.setDefaults($.datepicker.regional[""]);
$.datepicker.setDefaults($.datepicker.regional[<string>""]);
$(".selector").datepicker($.datepicker.regional["fr"]);
}

View File

@@ -1,6 +1,6 @@
///<reference path="logg.d.ts"/>
import logging = module("logg");
import logging = require("logg");
var logger = logging.getLogger('my.class');
logger = logging.getTransientLogger('my.class');

View File

@@ -2,7 +2,7 @@
declare var $: any;
function alert(thing: any) {
window.alert = function(thing?: string) {
$('#content').append('<div>' + thing + '</div>');
}
@@ -15,7 +15,7 @@ $(function () {
if (Modernizr.webgl) {
// loadAllWebGLScripts();
} else {
var msg = 'With a different browser you<EFBFBD>ll get to see the WebGL experience here: get.webgl.org.';
var msg = 'With a different browser youll get to see the WebGL experience here: get.webgl.org.';
document.getElementById('#notice').innerHTML = msg;
}

View File

@@ -17,12 +17,12 @@ function test_streaming() {
function test_explicit() {
var conn_str = "Driver={SQL Server Native Client 11.0};Server={(localdb)\\v11.0};Database={DBName};Trusted_Connection={Yes};";
sql.open(conn_str, function (err, conn) {
sql.open(conn_str, function (err?: Error, connection?: sql.Connection) {
if (err) {
console.log("Error opening the connection!");
return;
}
conn.queryRaw("SELECT * FROM TestTable", function (err, results) {
connection.queryRaw("SELECT * FROM TestTable", function (err?: Error, results?: sql.QueryRawResult, more?: boolean) {
if (err) {
console.log("Error running query!");
return;

View File

@@ -20,7 +20,7 @@ declare module "msnodesql" {
}
interface QueryCallback {
(err?: Error, results?: any[], more?: boolean): void;
(err?: Error, results?: QueryRawResult, more?: boolean): void;
}
interface QueryRawCallback {

View File

@@ -1802,7 +1802,7 @@ run_next_test = function run_next_test() {
test_count += 1;
tests[test_name]();
} else {
console.log('\n completed \x1b[32m%d\x1b[0m tests in \x1b[33m%d\x1b[0m ms\n', test_count, new Date() - all_start);
console.log('\n completed \x1b[32m%d\x1b[0m tests in \x1b[33m%d\x1b[0m ms\n', test_count, Date.now() - all_start);
client.quit();
client2.quit();
}

View File

@@ -107,21 +107,21 @@ function test_capture() {
}
var options = { limit: 3, duration: 10 };
navigator.device.capture.captureAudio(captureSuccess, captureError, options);
var captureSuccess = function (mediaFiles) {
function captureSuccess2(mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
path = mediaFiles[i].fullPath;
}
};
var captureError = function (error) {
function captureError2(error) {
navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
};
navigator.device.capture.captureImage(captureSuccess, captureError, { limit: 2 });
navigator.device.capture.captureImage(captureSuccess2, captureError2, { limit: 2 });
function captureImage() {
navigator.device.capture.captureImage(captureSuccess, captureError, { limit: 2 });
navigator.device.capture.captureImage(captureSuccess2, captureError2, { limit: 2 });
}
function captureVideo() {
navigator.device.capture.captureVideo(captureSuccess, captureError, { limit: 2 });
navigator.device.capture.captureVideo(captureSuccess2, captureError2, { limit: 2 });
}
}

View File

@@ -2,7 +2,7 @@
declare var $: any;
function alert(thing: any) {
window.alert = function(thing?: string) {
$('body').append('<div>' + thing + '</div>');
}

View File

@@ -1,6 +1,6 @@
/// <reference path="restify.d.ts" />
import restify = module("restify");
import restify = require("restify");
var server = restify.createServer({
formatters: {

View File

@@ -41,7 +41,7 @@ function test_canvas() {
function test_domlist() {
var container = document.getElementById("container");
var content = document.getElementById("content");
var refreshElem = content.getElementsByTagName("div")[0];
var refreshElem = <HTMLElement>content.getElementsByTagName("div")[0];
var scroller = new Scroller(render, {
scrollingX: false
});

382
sugar/sugar.d.ts vendored

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,10 @@
// Definitions by: John Vrbanac <john.vrbanac@linux.com> | https://github.com/jmvrbanac
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface External {
getUnityObject(version:number):Unity;
}
declare class UnitySettings {
public name:String;
public iconUrl:String;