TDD Flashcards
1
Q
TDD means…
A
Test Driven Development
2
Q
BDD means…
A
Behavior Driven Development (based on expected output)
3
Q
import chai (specifically 'expect')
A
const { expect } = require(‘chai’);
(const { toBeTested } = require(‘.’) ) imports index.js
4
Q
basic chai structure
A
describe("function", () => { it("does something", ()=>{ ... setup ... expect(function(x)).to.equal("result"); }); });
5
Q
chai for errors
A
needs anonymous function: expect(() => functionBeingTested()).to.throw; or expect(() => functionBeingTested()).to.throw(TypeError/ReferenceError, 'error message')