refactor: cleanup legacy sinon sandboxing (#7066)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
@@ -124,15 +124,11 @@ describe('BaseService', function () {
|
||||
})
|
||||
|
||||
describe('Logging', function () {
|
||||
let sandbox
|
||||
beforeEach(function () {
|
||||
sandbox = sinon.createSandbox()
|
||||
sinon.stub(trace, 'logTrace')
|
||||
})
|
||||
afterEach(function () {
|
||||
sandbox.restore()
|
||||
})
|
||||
beforeEach(function () {
|
||||
sandbox.stub(trace, 'logTrace')
|
||||
sinon.restore()
|
||||
})
|
||||
it('Invokes the logger as expected', async function () {
|
||||
await DummyService.invoke(
|
||||
@@ -426,15 +422,11 @@ describe('BaseService', function () {
|
||||
})
|
||||
|
||||
describe('request', function () {
|
||||
let sandbox
|
||||
beforeEach(function () {
|
||||
sandbox = sinon.createSandbox()
|
||||
sinon.stub(trace, 'logTrace')
|
||||
})
|
||||
afterEach(function () {
|
||||
sandbox.restore()
|
||||
})
|
||||
beforeEach(function () {
|
||||
sandbox.stub(trace, 'logTrace')
|
||||
sinon.restore()
|
||||
})
|
||||
|
||||
it('logs appropriate information', async function () {
|
||||
|
||||
@@ -99,14 +99,11 @@ describe('Cache header functions', function () {
|
||||
})
|
||||
|
||||
describe('setHeadersForCacheLength', function () {
|
||||
let sandbox
|
||||
beforeEach(function () {
|
||||
sandbox = sinon.createSandbox()
|
||||
sandbox.useFakeTimers()
|
||||
sinon.useFakeTimers()
|
||||
})
|
||||
afterEach(function () {
|
||||
sandbox.restore()
|
||||
sandbox = undefined
|
||||
sinon.restore()
|
||||
})
|
||||
|
||||
it('should set the correct Date header', function () {
|
||||
|
||||
@@ -10,15 +10,11 @@ describe('validate', function () {
|
||||
requiredString: Joi.string().required(),
|
||||
}).required()
|
||||
|
||||
let sandbox
|
||||
beforeEach(function () {
|
||||
sandbox = sinon.createSandbox()
|
||||
sinon.stub(trace, 'logTrace')
|
||||
})
|
||||
afterEach(function () {
|
||||
sandbox.restore()
|
||||
})
|
||||
beforeEach(function () {
|
||||
sandbox.stub(trace, 'logTrace')
|
||||
sinon.restore()
|
||||
})
|
||||
|
||||
const ErrorClass = InvalidParameter
|
||||
|
||||
Reference in New Issue
Block a user