Last active
November 21, 2018 08:04
-
-
Save microsoftly/ea5195deaa0a4725304c1742aa0256bc to your computer and use it in GitHub Desktop.
mocked http tests for awwCounter
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 { 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