7e20949956
- move all test files from core/test to test/ - updated all imports and other references - all code inside of core/ is then application code - tests are correctly at the root level - consistent with other repos/projects Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
29 lines
801 B
JavaScript
29 lines
801 B
JavaScript
const should = require('should');
|
|
const sinon = require('sinon');
|
|
const Promise = require('bluebird');
|
|
const sequence = require('../../../../core/server/lib/promise/sequence');
|
|
|
|
describe('Unit: lib/promise/sequence', function () {
|
|
afterEach(function () {
|
|
sinon.restore();
|
|
});
|
|
|
|
it('mixed tasks: promise and none promise', function () {
|
|
const tasks = [
|
|
function a() {
|
|
return Promise.resolve('hello');
|
|
},
|
|
function b() {
|
|
return 'from';
|
|
},
|
|
function c() {
|
|
return Promise.resolve('chio');
|
|
}
|
|
];
|
|
return sequence(tasks)
|
|
.then(function (result) {
|
|
result.should.eql(['hello','from', 'chio']);
|
|
});
|
|
});
|
|
});
|