This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var input = document.getElementsByTagName("input")[0]; | |
| fireunit.mouseDown( input ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test("first test ", function() { | |
| ok( true, "expecting true" ); | |
| var state = "stopped" | |
| equals( "stopped", state, "expecting stopped string" ); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('Math operation', { | |
| 'one plus two equals 3': function() { | |
| value_of(1 + 2).should_be(3); | |
| } | |
| }); | |
| describe('Boolean test', { | |
| before_all: function(){ | |
| state = "stopped"; | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe 'My operation' | |
| before_each | |
| state = "stopped"; | |
| end | |
| describe 'for math' | |
| it 'one plus two equals 3' | |
| (1+2).should.eql 3 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new Test.Unit.Runner({ | |
| setup: function() { | |
| }, | |
| teardown: function() { | |
| }, | |
| testTruth: function() { with(this) { | |
| assert(true); | |
| }}, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| }}, |
OlderNewer