Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update tests and documentation with asyncIt

Closes #7
  • Loading branch information...
commit 0b672c56638adedf003170479f169aa74abb55af 1 parent 05ba2a4
@joshuaclayton authored
Showing with 27 additions and 1 deletion.
  1. +12 −1 README.markdown
  2. +15 −0 specit.tests.js
View
13 README.markdown
@@ -9,7 +9,7 @@ I don't have the patience to write my own JS testing framework so I figured I'd
## Example
describe("SpecIt", function() {
- var john, cachedItems = [];
+ var john, cachedItems = [], something = false;
before(function() {
john = {name: "John Doe", age: 26};
@@ -47,6 +47,17 @@ I don't have the patience to write my own JS testing framework so I figured I'd
it("should run after callbacks", function() {
assert(cachedItems).should(beSimilarTo, []);
});
+
+ asyncIt("runs async tests correctly", function() {
+ setTimeout(function() {
+ something = true;
+ }, 50);
+
+ setTimeout(function() {
+ assert(something).should(be);
+ start();
+ }, 100);
+ });
});
## Supported Matchers
View
15 specit.tests.js
@@ -286,3 +286,18 @@ describe("SpecIt should know relative positions", function() {
assert($(".left-right-correct .right")).shouldNot(beAbove, ".left-right-correct .left");
});
});
+
+describe("SpecIt handles async tests", function() {
+ var something = false;
+
+ asyncIt("runs async tests correctly", function() {
+ setTimeout(function() {
+ something = true;
+ }, 50);
+
+ setTimeout(function() {
+ assert(something).should(be);
+ start();
+ }, 100);
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.