Skip to content

Instantly share code, notes, and snippets.

View bgergo's full-sized avatar

Gergo Boros bgergo

  • Cluj Napoca, Romania
View GitHub Profile
import {expect} from "chai";
import sinon from 'sinon';
import AbstractAnimal from './AbstractAnimal';
import Dog from './Dog';
describe('The Dog', () => {
describe("sleepySay() function", () => {
let stub;
import {expect} from "chai";
import sinon from 'sinon';
import AbstractAnimal from './AbstractAnimal';
import Dog from './Dog';
describe('The Dog', () => {
describe("sleepySay() function", () => {
let stub;
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'];
import {expect} from "chai";
import sinon from 'sinon';
import AbstractAnimal from './AbstractAnimal';
import Dog from './Dog';
describe('The Dog', () => {
describe("say() function", () => {
let spy;
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 {
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);
import AbstractAnimal from './AbstractAnimal';
export class FoxModel {
constructor () {
//
}
}
FoxModel.prototype.config = {
type: 'fox',
noise: null
import AbstractAnimal from './AbstractAnimal';
export class DogModel {
constructor () {}
}
DogModel.prototype.config = {
type: 'dog',
noise: 'woof'
export default class AbstractAnimal {
constructor(ModelClass) {
if (!ModelClass) {
throw new Error('Model is required to get the config obj');
}
this.config = {
type: '',
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');