Skip to content
Permalink
Browse files
add test labels (GH-140) (#172)
Co-authored-by: audreyso <auso@adobe.com>
Co-authored-by: Christopher J. Brody <chris.brody@gmail.com>
  • Loading branch information
Chris Brody and audreyso committed Sep 18, 2018
1 parent 0b56cbc commit 0f60f1a0e105e1fb00c72bf9aa269d6fff14d421
Showing 10 changed files with 116 additions and 116 deletions.
@@ -61,7 +61,7 @@ describe('android exec.processMessages', function () {
}

describe('exec', function () {
it('should process messages in order even when called recursively', function () {
it('Test#001 : should process messages in order even when called recursively', function () {
var firstCallbackId = null;
var callCount = 0;
nativeApi.exec.andCallFake(function (secret, service, action, callbackId, argsJson) {
@@ -100,7 +100,7 @@ describe('android exec.processMessages', function () {
expect(winSpy3).toHaveBeenCalledWith('three');
});
});
it('should process messages asynchronously', function () {
it('Test#002 : should process messages asynchronously', function () {
nativeApi.exec.andCallFake(function (secret, service, action, callbackId, argsJson) {
expect(secret).toBe(1234);
return createCallbackMessage(true, false, 1, callbackId, 'stwo');
@@ -139,63 +139,63 @@ describe('android exec.processMessages', function () {
waitsFor(function () { return callbackSpy.wasCalled; }, 200);
}

it('should handle payloads of false', function () {
it('Test#003 : should handle payloads of false', function () {
var messages = createCallbackMessage(true, true, 1, 'id', 'f');
performExecAndReturn(messages);
runs(function () {
expect(callbackSpy).toHaveBeenCalledWith('id', true, 1, [false], true);
});
});
it('should handle payloads of true', function () {
it('Test#004 : should handle payloads of true', function () {
var messages = createCallbackMessage(true, true, 1, 'id', 't');
performExecAndReturn(messages);
runs(function () {
expect(callbackSpy).toHaveBeenCalledWith('id', true, 1, [true], true);
});
});
it('should handle payloads of null', function () {
it('Test#005 : should handle payloads of null', function () {
var messages = createCallbackMessage(true, true, 1, 'id', 'N');
performExecAndReturn(messages);
runs(function () {
expect(callbackSpy).toHaveBeenCalledWith('id', true, 1, [null], true);
});
});
it('should handle payloads of numbers', function () {
it('Test#006 : should handle payloads of numbers', function () {
var messages = createCallbackMessage(true, true, 1, 'id', 'n-3.3');
performExecAndReturn(messages);
runs(function () {
expect(callbackSpy).toHaveBeenCalledWith('id', true, 1, [-3.3], true);
});
});
it('should handle payloads of strings', function () {
it('Test#007 : should handle payloads of strings', function () {
var messages = createCallbackMessage(true, true, 1, 'id', 'sHello world');
performExecAndReturn(messages);
runs(function () {
expect(callbackSpy).toHaveBeenCalledWith('id', true, 1, ['Hello world'], true);
});
});
it('should handle payloads of JSON objects', function () {
it('Test#008 : should handle payloads of JSON objects', function () {
var messages = createCallbackMessage(true, true, 1, 'id', '{"a":1}');
performExecAndReturn(messages);
runs(function () {
expect(callbackSpy).toHaveBeenCalledWith('id', true, 1, [{a: 1}], true);
});
});
it('should handle payloads of JSON arrays', function () {
it('Test#009 : should handle payloads of JSON arrays', function () {
var messages = createCallbackMessage(true, true, 1, 'id', '[1]');
performExecAndReturn(messages);
runs(function () {
expect(callbackSpy).toHaveBeenCalledWith('id', true, 1, [[1]], true);
});
});
it('should handle other callback opts', function () {
it('Test#010 : should handle other callback opts', function () {
var messages = createCallbackMessage(false, false, 3, 'id', 'sfoo');
performExecAndReturn(messages);
runs(function () {
expect(callbackSpy).toHaveBeenCalledWith('id', false, 3, ['foo'], false);
});
});
it('should handle multiple messages', function () {
it('Test#011 : should handle multiple messages', function () {
var message1 = createCallbackMessage(false, false, 3, 'id', 'sfoo');
var message2 = createCallbackMessage(true, true, 1, 'id', 'f');
var messages = message1 + message2;
@@ -211,7 +211,7 @@ describe('android exec.processMessages', function () {
expect(callbackSpy).toHaveBeenCalledWith('id', true, 1, [false], true);
});
});
it('should poll for more messages when hitting an *', function () {
it('Test#012 : should poll for more messages when hitting an *', function () {
var message1 = createCallbackMessage(false, false, 3, 'id', 'sfoo');
var message2 = createCallbackMessage(true, true, 1, 'id', 'f');
nativeApi.retrieveJsMessages.andCallFake(function () {
@@ -225,7 +225,7 @@ describe('android exec.processMessages', function () {
expect(callbackSpy).toHaveBeenCalledWith('id', true, 1, [false], true);
});
});
it('should call callbacks in order when one callback enqueues another.', function () {
it('Test#013 : should call callbacks in order when one callback enqueues another.', function () {
var message1 = createCallbackMessage(false, false, 3, 'id', 'scall1');
var message2 = createCallbackMessage(false, false, 3, 'id', 'scall2');
var message3 = createCallbackMessage(false, false, 3, 'id', 'scall3');
@@ -52,7 +52,7 @@ describe('iOS exec', function () {
}

describe('exec', function () {
it('should return "" from nativeFetchMessages work when nothing is pending.', function () {
it('Test#001 : should return "" from nativeFetchMessages work when nothing is pending.', function () {
var execPayload = exec.nativeFetchMessages();
expect(execPayload).toBe('');
});
@@ -32,44 +32,44 @@ describe('argscheck', function () {
argscheck.enableChecks = true;
});

it('should not throw when given valid args', function () {
it('Test#001 : should not throw when given valid args', function () {
var testFunc = createTestFunc(false);
testFunc(0, {}, [], '', new Date(), testFunc, 1);
});
it('should not throw when given valid optional args', function () {
it('Test#002 : should not throw when given valid optional args', function () {
var testFunc = createTestFunc(true);
testFunc(0, {}, [], '', new Date(), testFunc, '');
});
it('should not throw when given missing optional args', function () {
it('Test#003 : should not throw when given missing optional args', function () {
var testFunc = createTestFunc(true);
testFunc();
});
it('should not throw when given null optional args', function () {
it('Test#004 : should not throw when given null optional args', function () {
var testFunc = createTestFunc(true);
testFunc(null, null, null, null, null, null, null);
});
it('should throw when given invalid number', function () {
it('Test#005 : should throw when given invalid number', function () {
var testFunc = createTestFunc(true);
expect(function () { testFunc('foo', null, null, null, null, null); }).toThrow('Wrong type for parameter "num" of testFunc: Expected Number, but got String.');
});
it('should throw when given invalid object', function () {
it('Test#006 : should throw when given invalid object', function () {
var testFunc = createTestFunc(true);
// Do not allow arrays for objects since we're usually dealing with JSON when expecting objects.
expect(function () { testFunc(null, [], null, null, null, null); }).toThrow('Wrong type for parameter "obj" of testFunc: Expected Object, but got Array.');
});
it('should throw when given invalid array', function () {
it('Test#007 : should throw when given invalid array', function () {
var testFunc = createTestFunc(true);
expect(function () { testFunc(null, null, {}, null, null, null); }).toThrow('Wrong type for parameter "arr" of testFunc: Expected Array, but got Object.');
});
it('should throw when given invalid string', function () {
it('Test#008 : should throw when given invalid string', function () {
var testFunc = createTestFunc(true);
expect(function () { testFunc(null, null, null, 5, null, null); }).toThrow('Wrong type for parameter "str" of testFunc: Expected String, but got Number.');
});
it('should throw when given invalid date', function () {
it('Test#009 : should throw when given invalid date', function () {
var testFunc = createTestFunc(true);
expect(function () { testFunc(null, null, null, null, 233, null); }).toThrow('Wrong type for parameter "date" of testFunc: Expected Date, but got Number.');
});
it('should throw when given invalid function', function () {
it('Test#010 : should throw when given invalid function', function () {
var testFunc = createTestFunc(true);
expect(function () { testFunc(null, null, null, null, null, new Date()); }).toThrow('Wrong type for parameter "func" of testFunc: Expected Function, but got Date.');
});
@@ -23,7 +23,7 @@ describe('builder', function () {

var builder = require('cordova/builder');

it('includes the module into the target', function () {
it('Test#001 : includes the module into the target', function () {

var target = {};
var objects = {
@@ -37,7 +37,7 @@ describe('builder', function () {
expect(target.foo).toBe(require('cordova/builder'));
});

it('returns an empty object literal if no path', function () {
it('Test#002 : returns an empty object literal if no path', function () {
var target = {};
var objects = {cat: {}};

@@ -46,7 +46,7 @@ describe('builder', function () {
expect(target.cat).toBeDefined();
});

it('builds out the children', function () {
it('Test#003 : builds out the children', function () {

var target = {};
var objects = {

0 comments on commit 0f60f1a

Please sign in to comment.