diff --git a/breeze/breeze-1.0-tests.ts b/breeze/breeze-1.0-tests.ts index 6cc115e6f..7dc1dc453 100644 --- a/breeze/breeze-1.0-tests.ts +++ b/breeze/breeze-1.0-tests.ts @@ -1,7 +1,7 @@ /// -import breeze = module(Breeze); -import core = module(BreezeCore); +import breeze = Breeze; +import core = BreezeCore; function test_dataType() { var typ = breeze.DataType.DateTime; diff --git a/breeze/breeze-tests.ts b/breeze/breeze-tests.ts index 427547574..2f4dab1d1 100644 --- a/breeze/breeze-tests.ts +++ b/breeze/breeze-tests.ts @@ -1,6 +1,6 @@ /// -import core = module(breezeCore); +import core = breezeCore; function test_dataType() { var typ = breeze.DataType.DateTime; diff --git a/breeze/breeze.d.ts b/breeze/breeze.d.ts index 1522d1cd4..cb0aa13f9 100644 --- a/breeze/breeze.d.ts +++ b/breeze/breeze.d.ts @@ -748,7 +748,7 @@ declare module breeze { constructor (name: string, validatorFn: ValidatorFunction, context?: any); - static boolean(): Validator; + static bool(): Validator; static byte(): Validator; static date(): Validator; static duration(): Validator; diff --git a/gldatepicker/gldatepicker-tests.ts b/gldatepicker/gldatepicker-tests.ts index 885ec53ea..61efed8ce 100644 --- a/gldatepicker/gldatepicker-tests.ts +++ b/gldatepicker/gldatepicker-tests.ts @@ -40,6 +40,7 @@ $('#example3').glDatePicker( { date: new Date(0, 0, 1), data: { message: 'Happy New Year!' }, + repeatMonth: false, repeatYear: true }, ], diff --git a/jquery.transit/jquery.transit-tests.ts b/jquery.transit/jquery.transit-tests.ts index a5ed477e9..dda4cfd87 100644 --- a/jquery.transit/jquery.transit-tests.ts +++ b/jquery.transit/jquery.transit-tests.ts @@ -24,7 +24,7 @@ class Assert { static passedTests: number = 0; static Results() { - console.log('Tests succeeded - ' + passedTests + '/' + totalTests + '; Tests failed - ' + (totalTests - passedTests) + '/' + totalTests); + console.log('Tests succeeded - ' + this.passedTests + '/' + this.totalTests + '; Tests failed - ' + (this.totalTests - this.passedTests) + '/' + this.totalTests); } static AssertionFailed(actual: any, expected: any, test: string) { @@ -32,21 +32,21 @@ class Assert { } static Equal(actual: any, expected: any, test?: string) { - totalTests++; + this.totalTests++; if (actual === expected) { - passedTests++; + this.passedTests++; return; } - AssertionFailed(actual, expected, test); + this.AssertionFailed(actual, expected, test); } static NotEqual(actual: any, expected: any, test?: string) { - totalTests++; + this.totalTests++; if (actual !== expected) { - passedTests++; + this.passedTests++; return; } - AssertionFailed(actual, expected, test); + this.AssertionFailed(actual, expected, test); } } diff --git a/leapmotionTS/LeapMotionTS-tests.ts b/leapmotionTS/LeapMotionTS-tests.ts index 8ffc33e38..3fbdf0fc7 100755 --- a/leapmotionTS/LeapMotionTS-tests.ts +++ b/leapmotionTS/LeapMotionTS-tests.ts @@ -1,6 +1,6 @@ /// -import Leap = module('../LeapMotionTS'); +import Leap = module('LeapMotionTS'); var controller: Leap.Controller = new Leap.Controller(); controller.addEventListener(Leap.LeapEvent.LEAPMOTION_FRAME, (event: Leap.LeapEvent) => { diff --git a/phonegap/phonegap-tests.ts b/phonegap/phonegap-tests.ts index 843ac9fbb..2eabf75b0 100644 --- a/phonegap/phonegap-tests.ts +++ b/phonegap/phonegap-tests.ts @@ -73,9 +73,6 @@ function test_camera() { image.src = "data:image/jpeg;base64," + imageData; } - function onFail(message) { - alert('Failed because: ' + message); - } } function test_capture() { @@ -120,64 +117,12 @@ function test_capture() { navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error'); }; navigator.device.capture.captureImage(captureSuccess, captureError, { limit: 2 }); - function captureSuccess(mediaFiles) { - var i, len; - for (i = 0, len = mediaFiles.length; i < len; i += 1) { - uploadFile(mediaFiles[i]); - } - } - function captureError(error) { - var msg = 'An error occurred during capture: ' + error.code; - navigator.notification.alert(msg, null, 'Uh oh!'); - } function captureImage() { navigator.device.capture.captureImage(captureSuccess, captureError, { limit: 2 }); } - function uploadFile(mediaFile) { - var ft = new FileTransfer(), - path = mediaFile.fullPath, - name = mediaFile.name; - - ft.upload(path, - "http://my.domain.com/upload.php", - function (result) { - console.log('Upload success: ' + result.responseCode); - console.log(result.bytesSent + ' bytes sent'); - }, - function (error) { - console.log('Error uploading file ' + path + ': ' + error.code); - }, - { fileName: name }); - } - function captureSuccess(mediaFiles) { - var i, len; - for (i = 0, len = mediaFiles.length; i < len; i += 1) { - uploadFile(mediaFiles[i]); - } - } - function captureError(error) { - var msg = 'An error occurred during capture: ' + error.code; - navigator.notification.alert(msg, null, 'Uh oh!'); - } function captureVideo() { navigator.device.capture.captureVideo(captureSuccess, captureError, { limit: 2 }); } - function uploadFile(mediaFile) { - var ft = new FileTransfer(), - path = mediaFile.fullPath, - name = mediaFile.name; - - ft.upload(path, - "http://my.domain.com/upload.php", - function (result) { - console.log('Upload success: ' + result.responseCode); - console.log(result.bytesSent + ' bytes sent'); - }, - function (error) { - console.log('Error uploading file ' + path + ': ' + error.code); - }, - { fileName: name }); - } } function test_compass() { @@ -191,9 +136,10 @@ function test_compass() { function onError(compassError) { alert('Compass Error: ' + compassError.code); } +} + +function test_compass2() { var watchID = null; - - document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { startWatch(); @@ -215,7 +161,9 @@ function test_compass() { function onError(compassError) { alert('Compass error: ' + compassError.code); } - +} +function test_compass3() { + var watchID = null; function startWatch() { var options = { frequency: 3000 }; watchID = navigator.compass.watchHeading(onSuccess, onError, options); @@ -281,7 +229,17 @@ function test_contacts() { console.log("Original contact name = " + contact.name.givenName); console.log("Cloned contact name = " + clone.name.givenName); contact.remove(onSuccess, onError); - +} +function test_contacts2() { + + function onSuccess(contacts) { + for (var i = 0; i < contacts.length; i++) { + console.log("Display Name = " + contacts[i].displayName); + } + } + function onError(contactError) { + alert('onError!'); + } function onDeviceReady() { var contact = navigator.contacts.create(); contact.displayName = "Plumber"; @@ -375,7 +333,8 @@ function test_file() { function fail(evt) { console.log(evt.target.error.code); } - +} +function test_file2() { function onDeviceReady() { window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail); } @@ -403,7 +362,8 @@ function test_file() { function fail(error) { console.log(error.code); } - +} +function test_file3() { function onDeviceReady() { window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail); } @@ -459,11 +419,6 @@ function test_file() { console.log("Response = " + r.response); console.log("Sent = " + r.bytesSent); } - function fail(error) { - alert("An error has occurred: Code = " + error.code); - console.log("upload error source " + error.source); - console.log("upload error target " + error.target); - } var uri = encodeURI("http://some.server.com/upload.php"); var fileURI = ""; var options = new FileUploadOptions(); @@ -480,20 +435,21 @@ function test_file() { function test_geolocation() { var onSuccess = function (position) { alert('Latitude: ' + position.coords.latitude + '\n' + - 'Longitude: ' + position.coords.longitude + '\n' + - 'Altitude: ' + position.coords.altitude + '\n' + - 'Accuracy: ' + position.coords.accuracy + '\n' + - 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' + - 'Heading: ' + position.coords.heading + '\n' + - 'Speed: ' + position.coords.speed + '\n' + - 'Timestamp: ' + position.timestamp + '\n'); + 'Longitude: ' + position.coords.longitude + '\n' + + 'Altitude: ' + position.coords.altitude + '\n' + + 'Accuracy: ' + position.coords.accuracy + '\n' + + 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' + + 'Heading: ' + position.coords.heading + '\n' + + 'Speed: ' + position.coords.speed + '\n' + + 'Timestamp: ' + position.timestamp + '\n'); }; function onError(error: GeolocationError) { alert('code: ' + error.code + '\n' + - 'message: ' + error.message + '\n'); + 'message: ' + error.message + '\n'); } navigator.geolocation.getCurrentPosition(onSuccess, onError); - +} +function test_geolocation2() { function onSuccess(position) { var element = document.getElementById('geolocation'); element.innerHTML = 'Latitude: ' + position.coords.latitude + '
' + @@ -606,7 +562,8 @@ function test_inAppBrowser() { } function test_media() { - var my_media = new Media(src, ()=>{}, ()=>{}); + var src = ''; + var my_media = new Media(src, () => { }, () => { }); var mediaTimer = setInterval(function () { my_media.getCurrentPosition( function (position) { @@ -617,7 +574,7 @@ function test_media() { function (e) { console.log("Error getting pos=" + e); } - ); + ); }, 1000); var counter = 0; @@ -646,7 +603,8 @@ function test_media() { my_media.pause(); }, 10000); } - +} +function test_media2() { function playAudio(url) { var my_media = new Media(url, function () { diff --git a/platform/platform-tests.ts b/platform/platform-tests.ts index 9b2f84e78..0a928e03a 100644 --- a/platform/platform-tests.ts +++ b/platform/platform-tests.ts @@ -1,6 +1,6 @@ /// -declare interface ITestContainer { +interface ITestContainer { [name: string]: PlatformStatic; } @@ -54,7 +54,7 @@ function runTests() { onFalse = (name: string) => { - return function () => { + return () => { console.log('\tfailed on prop "' + name + '" for "' + n + '"'); } } diff --git a/platform/platform.d.ts b/platform/platform.d.ts index 49385f1a9..7d93e421f 100644 --- a/platform/platform.d.ts +++ b/platform/platform.d.ts @@ -14,8 +14,8 @@ interface PlatformStatic { ua?: string; version?: string; os?: PlatformOS; - parse(ua: string): PlatformStatic; - toString(): string; + parse?(ua: string): PlatformStatic; + toString?(): string; } interface PlatformOS {