-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from findzen/master
AMD module testing for BBB
- Loading branch information
Showing
3 changed files
with
84 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,91 @@ | ||
describe("one tautology", function() { | ||
it("is a tautology", function() { | ||
expect(true).to.be.true; | ||
}); | ||
define([ | ||
|
||
describe("is awesome", function() { | ||
it("is awesome", function() { | ||
expect(1).to.equal(1); | ||
}); | ||
}); | ||
}); | ||
// import the module to be tested | ||
'../../app/scripts/app' | ||
|
||
describe("simple tests", function() { | ||
it("increments", function() { | ||
var mike = 0; | ||
], function(module) { | ||
'use strict'; | ||
|
||
expect(mike++ === 0).to.be.true; | ||
expect(mike === 1).to.be.true; | ||
describe("module", function() { | ||
it("has trigger method", function() { | ||
expect(module.trigger).to.be.a("function") | ||
}); | ||
}); | ||
|
||
it("increments (improved)", function() { | ||
var mike = 0; | ||
describe("one tautology", function() { | ||
it("is a tautology", function() { | ||
expect(true).to.be.true; | ||
}); | ||
|
||
expect(mike++).to.equal(0); | ||
expect(mike).to.equal(1); | ||
describe("is awesome", function() { | ||
it("is awesome", function() { | ||
expect(1).to.equal(1); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("setUp/tearDown", function() { | ||
beforeEach(function() { | ||
// console.log("Before"); | ||
}); | ||
describe("simple tests", function() { | ||
it("increments", function() { | ||
var mike = 0; | ||
|
||
afterEach(function() { | ||
// console.log("After"); | ||
}); | ||
expect(mike++ === 0).to.be.true; | ||
expect(mike === 1).to.be.true; | ||
}); | ||
|
||
it("example", function() { | ||
// console.log("During"); | ||
it("increments (improved)", function() { | ||
var mike = 0; | ||
|
||
expect(mike++).to.equal(0); | ||
expect(mike).to.equal(1); | ||
}); | ||
}); | ||
|
||
describe("setUp/tearDown", function() { | ||
beforeEach(function() { | ||
// console.log("Before2"); | ||
// console.log("Before"); | ||
}); | ||
|
||
afterEach(function() { | ||
// console.log("After2"); | ||
// console.log("After"); | ||
}); | ||
|
||
it("example", function() { | ||
// console.log("During Nested"); | ||
// console.log("During"); | ||
}); | ||
|
||
describe("setUp/tearDown", function() { | ||
beforeEach(function() { | ||
// console.log("Before2"); | ||
}); | ||
|
||
afterEach(function() { | ||
// console.log("After2"); | ||
}); | ||
|
||
it("example", function() { | ||
// console.log("During Nested"); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("async", function() { | ||
it("multiple async", function(done) { | ||
var semaphore = 2; | ||
describe("async", function() { | ||
it("multiple async", function(done) { | ||
var semaphore = 2; | ||
|
||
setTimeout(function() { | ||
expect(true).to.be.true; | ||
semaphore--; | ||
}, 500); | ||
setTimeout(function() { | ||
expect(true).to.be.true; | ||
semaphore--; | ||
}, 500); | ||
|
||
setTimeout(function() { | ||
expect(true).to.be.true; | ||
semaphore--; | ||
}, 500); | ||
setTimeout(function() { | ||
expect(true).to.be.true; | ||
semaphore--; | ||
}, 500); | ||
|
||
setTimeout(function() { | ||
expect(semaphore).to.equal(0); | ||
done(); | ||
}, 600); | ||
setTimeout(function() { | ||
expect(semaphore).to.equal(0); | ||
done(); | ||
}, 600); | ||
}); | ||
}); | ||
}); | ||
|