Skip to content

Instantly share code, notes, and snippets.

@microsoftly
Last active November 21, 2018 08:04
Show Gist options
  • Save microsoftly/ea5195deaa0a4725304c1742aa0256bc to your computer and use it in GitHub Desktop.
Save microsoftly/ea5195deaa0a4725304c1742aa0256bc to your computer and use it in GitHub Desktop.
mocked http tests for awwCounter
import { expect } from 'chai';
import { TapeDeck } from 'mocha-tape-deck';
import { getDogAndCatTitleCount } from './awwCounter';
describe('Aww counter component test', function () {
const deck = new TapeDeck('./cassettes');
deck.createTest('Expects 2 cats and 5 dogs when selecting 20 titles', async () => {
const { cat, dog } = await getDogAndCatTitleCount(20);
expect(cat).to.be.equal(2)
expect(dog).to.be.equal(3);
})
.register(this)
deck.createTest('Expects 1 cat and 0 dogs when selecting 1 title', async () => {
const { cat, dog } = await getDogAndCatTitleCount(1);
expect(cat).to.be.equal(1)
expect(dog).to.be.equal(0);
})
.register(this)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment