nostream/test/unit/factories/settings-factory.spec.ts
Ricardo Arturo Cabral Mejia 46cd022598
test: refactor settings
2022-11-08 23:52:21 -05:00

24 lines
598 B
TypeScript

import { expect } from 'chai'
import Sinon from 'sinon'
import { createSettings } from '../../../src/factories/settings-factory'
import { SettingsStatic } from '../../../src/utils/settings'
describe('getSettings', () => {
let createSettingsStub: Sinon.SinonStub
beforeEach(() => {
createSettingsStub = Sinon.stub(SettingsStatic, 'createSettings')
})
afterEach(() => {
createSettingsStub.restore()
})
it('calls createSettings and returns', () => {
const settings = Symbol()
createSettingsStub.returns(settings)
expect(createSettings()).to.equal(settings)
})
})