mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
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']);
|
|
});
|
|
});
|
|
});
|