Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated sinon sandbox factory method #5267

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/Observable-spec.ts
Expand Up @@ -250,7 +250,7 @@ describe('Observable', () => {
});

it('should run unsubscription logic when an error is sent asynchronously and subscribe is called with no arguments', (done) => {
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();

let unsubscribeCalled = false;
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/dom/ajax-spec.ts
Expand Up @@ -15,7 +15,7 @@ describe('ajax', () => {
let sandbox: sinon.SinonSandbox;

beforeEach(() => {
sandbox = sinon.sandbox.create();
sandbox = sinon.createSandbox();
gXHR = global.XMLHttpRequest;
rXHR = root.XMLHttpRequest;

Expand Down
6 changes: 3 additions & 3 deletions spec/observables/interval-spec.ts
Expand Up @@ -63,7 +63,7 @@ describe('interval', () => {
});

it('should create an observable emitting periodically with the AsapScheduler', (done: MochaDone) => {
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
const period = 10;
const events = [0, 1, 2, 3, 4, 5];
Expand All @@ -90,7 +90,7 @@ describe('interval', () => {
});

it('should create an observable emitting periodically with the QueueScheduler', (done: MochaDone) => {
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
const period = 10;
const events = [0, 1, 2, 3, 4, 5];
Expand All @@ -117,7 +117,7 @@ describe('interval', () => {
});

it('should create an observable emitting periodically with the AnimationFrameScheduler', (done: MochaDone) => {
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
const period = 10;
const events = [0, 1, 2, 3, 4, 5];
Expand Down
2 changes: 1 addition & 1 deletion spec/operators/catch-spec.ts
Expand Up @@ -397,7 +397,7 @@ describe('catchError operator', () => {

beforeEach(() => {
trueSetTimeout = global.setTimeout;
sandbox = sinon.sandbox.create();
sandbox = sinon.createSandbox();
timers = sandbox.useFakeTimers();
});

Expand Down
4 changes: 2 additions & 2 deletions spec/schedulers/AnimationFrameScheduler-spec.ts
Expand Up @@ -12,7 +12,7 @@ describe('Scheduler.animationFrame', () => {

it('should act like the async scheduler if delay > 0', () => {
let actionHappened = false;
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
animationFrame.schedule(() => {
actionHappened = true;
Expand All @@ -27,7 +27,7 @@ describe('Scheduler.animationFrame', () => {

it('should cancel animationFrame actions when unsubscribed', () => {
let actionHappened = false;
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
animationFrame.schedule(() => {
actionHappened = true;
Expand Down
8 changes: 4 additions & 4 deletions spec/schedulers/AsapScheduler-spec.ts
Expand Up @@ -12,7 +12,7 @@ describe('Scheduler.asap', () => {

it('should act like the async scheduler if delay > 0', () => {
let actionHappened = false;
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
asap.schedule(() => {
actionHappened = true;
Expand All @@ -27,7 +27,7 @@ describe('Scheduler.asap', () => {

it('should cancel asap actions when delay > 0', () => {
let actionHappened = false;
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
asap.schedule(() => {
actionHappened = true;
Expand All @@ -41,7 +41,7 @@ describe('Scheduler.asap', () => {
});

it('should reuse the interval for recursively scheduled actions with the same delay', () => {
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
// callThrough is missing from the declarations installed by the typings tool in stable
const stubSetInterval = (<any> sinon.stub(global, 'setInterval')).callThrough();
Expand All @@ -68,7 +68,7 @@ describe('Scheduler.asap', () => {
});

it('should not reuse the interval for recursively scheduled actions with a different delay', () => {
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
// callThrough is missing from the declarations installed by the typings tool in stable
const stubSetInterval = (<any> sinon.stub(global, 'setInterval')).callThrough();
Expand Down
4 changes: 2 additions & 2 deletions spec/schedulers/QueueScheduler-spec.ts
Expand Up @@ -8,7 +8,7 @@ const queue = queueScheduler;
describe('Scheduler.queue', () => {
it('should act like the async scheduler if delay > 0', () => {
let actionHappened = false;
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();
queue.schedule(() => {
actionHappened = true;
Expand All @@ -22,7 +22,7 @@ describe('Scheduler.queue', () => {
});

it('should switch from synchronous to asynchronous at will', () => {
const sandbox = sinon.sandbox.create();
const sandbox = sinon.createSandbox();
const fakeTimer = sandbox.useFakeTimers();

let asyncExec = false;
Expand Down