tikiwiki/packages/tiki-pkg-casperjs/jerome-breton/casperjs/tests/suites/tester/setup-teardown-async.js
2023-11-20 20:52:04 +00:00

31 lines
689 B
JavaScript
Executable File

/*eslint strict:0*/
var setUp, tearDown;
casper.test.setUp(function(done) {
setTimeout(function() {
setUp = true;
done();
}, 50);
});
casper.test.tearDown(function(done) {
setTimeout(function() {
tearDown = true;
done();
// reset
casper.test.setUp();
casper.test.tearDown();
}, 50);
});
casper.test.begin('setUp() tests', 1, function(test) {
test.assertTrue(setUp, 'Tester.setUp() executed the async setup function');
test.done();
});
casper.test.begin('tearDown() tests', 1, function(test) {
test.assertTrue(tearDown, 'Tester.tearDown() executed the async tear down function');
test.done();
});