qunit-harness
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "qunit-harness", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A library for running qunit tests on a local machine and in the SauceLabs environment.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/AlexanderMoskovkin/qunit-harness", |
@@ -76,2 +76,28 @@ # qunit-harness | ||
##QUnit tests | ||
####Wait for an async action | ||
```js | ||
window.QUnitGlobals.wait(condition); // returns Promise | ||
// condition is a function | ||
// The test will fail with the timeout error if condition returns 'false' within 3000 ms. | ||
``` | ||
Example: | ||
```js | ||
asyncTest('test with wait', function () { | ||
var resolved = false; | ||
window.setTimeout(function () { | ||
resolved = true; | ||
}, 50); | ||
window.QUnitGlobals.wait(function () { | ||
return resolved; | ||
}) | ||
.then(function () { | ||
ok(true); | ||
start(); | ||
}); | ||
}); | ||
``` | ||
####Get test server hostname | ||
@@ -78,0 +104,0 @@ ```js |
Sorry, the diff of this file is not supported yet
13011
158
459103