Skip to content

Commit

Permalink
Remove unneeded before hook that didn't work with jest.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Jan 19, 2017
1 parent 6c11203 commit d274b0f
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions test/api/async.spec.js
@@ -1,31 +1,28 @@
/*global expect*/
describe('async', function () {
var workQueue = typeof weknowhow === 'undefined' ? require('../../lib/workQueue') : null;
var clonedExpect;
before(function () {
clonedExpect = expect.clone()
.addAssertion('to be sorted after delay', function (expect, subject, delay) {
expect.errorMode = 'nested';
var clonedExpect = expect.clone()
.addAssertion('to be sorted after delay', function (expect, subject, delay) {
expect.errorMode = 'nested';

return expect.promise(function (run) {
setTimeout(run(function () {
expect(subject, 'to be an array');
expect(subject, 'to equal', [].concat(subject).sort());
}), delay);
});
})
.addAssertion('to be ordered after delay', function (expect, subject) {
expect.errorMode = 'nested';
return expect(subject, 'to be sorted after delay', 20);
})
.addAssertion('im sync', function (expect, subject) {
return expect.promise(function (run) {
run(function () {
expect(subject, 'to be', 24);
})();
});
return expect.promise(function (run) {
setTimeout(run(function () {
expect(subject, 'to be an array');
expect(subject, 'to equal', [].concat(subject).sort());
}), delay);
});
});
})
.addAssertion('to be ordered after delay', function (expect, subject) {
expect.errorMode = 'nested';
return expect(subject, 'to be sorted after delay', 20);
})
.addAssertion('im sync', function (expect, subject) {
return expect.promise(function (run) {
run(function () {
expect(subject, 'to be', 24);
})();
});
});


it('fails if it is called without a callback', function () {
Expand Down

0 comments on commit d274b0f

Please sign in to comment.