This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {expect} from "chai"; | |
| import sinon from 'sinon'; | |
| import AbstractAnimal from './AbstractAnimal'; | |
| import Dog from './Dog'; | |
| describe('The Dog', () => { | |
| describe("sleepySay() function", () => { | |
| let stub; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {expect} from "chai"; | |
| import sinon from 'sinon'; | |
| import AbstractAnimal from './AbstractAnimal'; | |
| import Dog from './Dog'; | |
| describe('The Dog', () => { | |
| describe("sleepySay() function", () => { | |
| let stub; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {expect} from "chai"; | |
| import sinon from 'sinon'; | |
| import proxyquire from 'proxyquire'; | |
| proxyquire.noCallThru(); | |
| let AbstractAnimalStub = sinon.stub(); | |
| let Dog = proxyquire('./Dog', {'./AbstractAnimal' : AbstractAnimalStub}); | |
| let DogModel = Dog['DogModel']; | |
| Dog = Dog['default']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {expect} from "chai"; | |
| import sinon from 'sinon'; | |
| import AbstractAnimal from './AbstractAnimal'; | |
| import Dog from './Dog'; | |
| describe('The Dog', () => { | |
| describe("say() function", () => { | |
| let spy; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should check phone numbers against global DNC if no DNC list exists for the specific environment', (done) => { | |
| getByEnvironmentStub.returns(Promise.resolve()); | |
| let contactCrud = new ContactCrudServer(connectionMock); | |
| let dncedContacts = contactCrud.getContactsOnDNC(data, 'testEnv2'); | |
| dncedContacts.then( | |
| success => { | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should check phone numbers against global DNC if no DNC list exists for the specific environment', (done) => { | |
| getByEnvironmentStub.returns(Promise.resolve()); | |
| let expectedResult = { | |
| dnc: [data[2]], | |
| ok: [data[0], data[1]] | |
| }; | |
| let contactCrud = new ContactCrudServer(connectionMock); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import AbstractAnimal from './AbstractAnimal'; | |
| export class FoxModel { | |
| constructor () { | |
| // | |
| } | |
| } | |
| FoxModel.prototype.config = { | |
| type: 'fox', | |
| noise: null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import AbstractAnimal from './AbstractAnimal'; | |
| export class DogModel { | |
| constructor () {} | |
| } | |
| DogModel.prototype.config = { | |
| type: 'dog', | |
| noise: 'woof' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class AbstractAnimal { | |
| constructor(ModelClass) { | |
| if (!ModelClass) { | |
| throw new Error('Model is required to get the config obj'); | |
| } | |
| this.config = { | |
| type: '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {expect} from "chai"; | |
| import sinon from 'sinon'; | |
| import Fox from './Fox'; | |
| describe('The Fox', () => { | |
| describe("say() function", () => { | |
| it('should throw exception', () => { | |
| let fox = new Fox(); | |
| expect(() => fox.say()).to.throw(Error, 'No one knows this sound'); |
NewerOlder