Ghost/ghost/promise/test/sequence_spec.js
Hannah Wolfe 7e20949956 Move tests from core to root (#11700)
- 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>
2020-03-30 16:26:47 +01:00

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']);
});
});
});