mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Bumped sinon from 4.4.6 to 7.3.2 (#10400)
refs #9389 - https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md Breaking changes for Ghost: - no need to create a sandbox anymore, each file get's it's own sandbox - just require sinon and use this sandbox - you can still create separate sandboxes with .createSandbox - reset single stubs: use .resetHistory instead of .reset This is a global replace for any sandbox creation. --- From https://sinonjs.org/releases/v7.2.3/sandbox/ > Default sandbox > Since sinon@5.0.0, the sinon object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.
This commit is contained in:
parent
eb9b1ddc1f
commit
549cc7e47f
1 changed files with 7 additions and 8 deletions
|
@ -4,11 +4,10 @@ const fs = require('fs-extra');
|
||||||
const common = require('../../../../server/lib/common');
|
const common = require('../../../../server/lib/common');
|
||||||
const manipulator = require('../../../../server/lib/image/manipulator');
|
const manipulator = require('../../../../server/lib/image/manipulator');
|
||||||
const testUtils = require('../../../utils');
|
const testUtils = require('../../../utils');
|
||||||
const sandbox = sinon.sandbox.create();
|
|
||||||
|
|
||||||
describe('lib/image: manipulator', function () {
|
describe('lib/image: manipulator', function () {
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
sandbox.restore();
|
sinon.restore();
|
||||||
testUtils.unmockNotExistingModule();
|
testUtils.unmockNotExistingModule();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -43,16 +42,16 @@ describe('lib/image: manipulator', function () {
|
||||||
let sharp, sharpInstance;
|
let sharp, sharpInstance;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
sandbox.stub(fs, 'readFile').resolves('original');
|
sinon.stub(fs, 'readFile').resolves('original');
|
||||||
sandbox.stub(fs, 'writeFile').resolves();
|
sinon.stub(fs, 'writeFile').resolves();
|
||||||
|
|
||||||
sharpInstance = {
|
sharpInstance = {
|
||||||
resize: sandbox.stub().returnsThis(),
|
resize: sinon.stub().returnsThis(),
|
||||||
rotate: sandbox.stub().returnsThis(),
|
rotate: sinon.stub().returnsThis(),
|
||||||
toBuffer: sandbox.stub(),
|
toBuffer: sinon.stub(),
|
||||||
};
|
};
|
||||||
|
|
||||||
sharp = sandbox.stub().callsFake(() => {
|
sharp = sinon.stub().callsFake(() => {
|
||||||
return sharpInstance;
|
return sharpInstance;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue