Skip to content

Commit

Permalink
use spec_helper in StreamActivityMonitor_spec due to global sinon clo…
Browse files Browse the repository at this point in the history
…ck changes
  • Loading branch information
cacieprins committed Mar 25, 2024
1 parent a03d13b commit 4e839a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 8 additions & 4 deletions packages/server/test/spec_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ sinon.restore = function (...args) {
return restore.apply(sinon, args)
}

mockery.enable({
warnOnUnregistered: false,
})

// stub out the entire electron object for our stub
// we must use an absolute path here because of the way mockery internally loads this
// module - meaning the first time electron is required it'll use this path string
Expand All @@ -96,11 +92,19 @@ mockery.registerSubstitute(
mockery.registerMock('original-fs', {})

before(function () {
mockery.enable({
warnOnUnregistered: false,
})

if (hasOnly) {
this.test.parent._onlyTests = [true]
}
})

after((() => {
mockery.disable()
}))

// appData.ensure()

const { setCtx, getCtx, clearCtx, makeDataContext } = require('../lib/makeDataContext')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import sinon from 'sinon'
import chai, { expect } from 'chai'
import chaiAsPromised from 'chai-as-promised'
require('../../../spec_helper')
import { StreamActivityMonitor, StreamStalledError, StreamStartTimedOutError } from '../../../../lib/cloud/upload/StreamActivityMonitor'

chai.use(chaiAsPromised)

describe('StreamTimeoutController', () => {
const maxStartDwellTime = 1000
const maxActivityDwellTime = 500
Expand Down

0 comments on commit 4e839a4

Please sign in to comment.