general-tests.js revision fd333de8980ee26528bbe26837b8c14fabfc2abe
var simpleReport = {
passed: 2,
failed: 2,
ignored: 1,
total: 5,
type: "report",
name: "YUI Test Results",
duration: 500,
"Some Suite":{
passed: 2,
failed: 2,
ignored: 1,
total: 5,
type: "testsuite",
name: "Some Suite",
duration: 356,
"Some Tests": {
passed: 2,
failed: 2,
ignored: 1,
total: 5,
type: "testcase",
name: "Some Tests",
duration: 250,
test1:{
result: "pass",
message: "Test passed.",
type: "test",
name: "test1",
duration: 25
},
test2:{
result: "pass",
message: "Test passed.",
type: "test",
name: "test2",
duration: 30
},
test3:{
result: "ignore",
message: "Test ignored.",
type: "test",
name: "test3",
duration: 35
},
test4:{
result: "fail",
message: "Test failed.",
type: "test",
name: "test4",
duration: 45
},
test5:{
result: "fail",
message: "Test failed.",
type: "test",
name: "test5",
duration: 50
}
}
}
};
'test: resume without wait': function() {
this.resume(function() {
//Nothing
});
},
'test: wait without function': function() {
this.wait(100);
},
_should: {
error: {
'test: resume without wait': true,
},
fail: {
'test: wait without function': true
}
}
}));
'test: suite with no name': function() {
},
'test: case with no name': function() {
},
'test: callback': function() {
},
'test: assert': function() {
this.assert(true, 'Assert');
},
'test: assert no condition': function() {
this.assert();
},
'test: assert.fail': function() {
this.fail('Failed');
},
_should: {
fail: {
'test: assert.fail': true,
'test: assert no condition': true
}
}
}));
name: 'EventTarget',
'test: attach': function() {
var noop = function() {};
}
}));
name: 'General Asserts',
'test: asserts': function() {
Assert.areNotEqual(true, false);
Y.assert(true);
},
'test: asserts fail areNotEqual': function() {
Assert.areNotEqual(true, true);
},
'test: asserts fail areNotSame': function() {
},
'test: asserts fail isFalse': function() {
},
'test: asserts fail isTrue': function() {
},
'test: asserts fail isNaN': function() {
},
'test: asserts fail isNotNaN': function() {
},
'test: asserts fail isNull': function() {
},
'test: asserts fail isNotNull': function() {
},
'test: asserts fail isUndefined': function() {
Assert.isUndefined(false);
},
'test: asserts fail isNotUndefined': function() {
},
'test: asserts fail isArray': function() {
},
'test: asserts fail isInstanceOf': function() {
},
'test: asserts fail isTypeOf': function() {
},
'test: Y.assert fail': function() {
Y.assert(false);
},
_should: {
fail: {
'test: asserts fail areNotEqual': true,
'test: asserts fail areNotSame': true,
'test: asserts fail isFalse': true,
'test: asserts fail isTrue': true,
'test: asserts fail isNaN': true,
'test: asserts fail isNotNaN': true,
'test: asserts fail isNull': true,
'test: asserts fail isNotNull': true,
'test: asserts fail isUndefined': true,
'test: asserts fail isNotUndefined': true,
'test: asserts fail isArray': true,
'test: asserts fail isInstanceOf': true,
'test: asserts fail isTypeOf': true,
'test: Y.assert fail': true
}
}
}));
var DateAssert = Y.DateAssert;
name: 'Date Tests',
'test: datesAreEqual()': function() {
},
'test: datesAreEqual() fail': function() {
var date1 = new Date();
},
'test: timesAreEqual()': function() {
},
'test: timesAreEqual() fail': function() {
var date1 = new Date('01/01/1999 16:16:16');
},
'test: should error for not passing dates': function() {
DateAssert.datesAreEqual(null, null);
},
'test: should error for not passing times': function() {
DateAssert.timesAreEqual(null, null);
},
_should: {
fail: {
'test: datesAreEqual() fail': true,
'test: timesAreEqual() fail': true
},
error: {
'test: should error for not passing dates': true,
'test: should error for not passing times': true
}
}
}));
name: 'Runner Tests',
'test: set name': function() {
var setName = 'YUITest Test Suite',
},
'test: ignore': function() {
},
},
'test: getResults': function() {
},
'test: clear': function() {
},
'test: _getCount and reset': function() {
},
_should: {
ignore: {
'test: ignore': true
}
}
}));
name: 'Error Tests',
'test: Assert.Error': function() {
},
'test: Assert.ComparisonFailure': function() {
Assert.areEqual('ComparisonFailure: ComparisonFailure Error\nExpected: false (boolean)\nActual: true (boolean)', e.toString());
Assert.areEqual('ComparisonFailure: ComparisonFailure Error\nExpected: false (boolean)\nActual: true (boolean)', e.valueOf());
},
'test: Assert.UnexpectedValue': function() {
Assert.areEqual('UnexpectedValue: UnexpectedValueError\nUnexpected: false (boolean) ', e.toString());
Assert.areEqual('UnexpectedValue: UnexpectedValueError\nUnexpected: false (boolean) ', e.valueOf());
}
}));
name: 'Reporter',
'test: report': function() {
var url = "http://foobar.com/";
}
}));
});