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