Skip to content

Instantly share code, notes, and snippets.

View zaparka's full-sized avatar

Petr Zaparka zaparka

View GitHub Profile
// Simple true-like/false-like testing
fireunit.ok( true, "I'm going to pass!" );
fireunit.ok( false, "I'm going to fail!" );
// Compare two strings - shows a diff of the// results if they're different
fireunit.compare( "The lazy fox jumped over the log.",
"The lazy brown fox jumped the log.",
"Are these two strings the same?");
// Display the total results
var input = document.getElementsByTagName("input")[0];
fireunit.mouseDown( input );
test("first test ", function() {
ok( true, "expecting true" );
var state = "stopped"
equals( "stopped", state, "expecting stopped string" );
});
module("First 2 tests");
test("first test ", function() {
ok( true, "expecting true" );
var state = "stopped"
equals( "stopped", state, "expecting stopped string" );
});
test("second test", function() {
var arr = [1,2,3]
describe("First describe", function() {
before(function() {
state = "stopped";
});
it("expecting true", function() {
true.should(beA, Boolean);
});
it("expecting stopped string", function() {
state.should(eql, "stopped");
});
describe('Math operation', {
'one plus two equals 3': function() {
value_of(1 + 2).should_be(3);
}
});
describe('Boolean test', {
before_all: function(){
state = "stopped";
},
describe 'My operation'
before_each
state = "stopped";
end
describe 'for math'
it 'one plus two equals 3'
(1+2).should.eql 3
end
YUI({ useBrowserConsole: true }).use('test', function(Y) {
var testCase = new Y.Test.Case({
name: "My operation",
setUp : function () {
this.state = "running";
},
tearDown : function () {
delete this.state;
},
new Test.Unit.Runner({
setup: function() {
},
teardown: function() {
},
testTruth: function() { with(this) {
assert(true);
}},
});
new Test.Unit.Runner({
setup: function() {
state = "stopped";
pomodoro_timer = {state: 'paused', name: 'Recent Pomodoro iteration'}
agile_arr = ['is','agile', 'awesome']
},
testBoolean: function() { with(this) {
assertEqual(2, 1+1);
}},