TDD Flashcards

1
Q

TDD means…

A

Test Driven Development

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

BDD means…

A

Behavior Driven Development (based on expected output)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
import chai
(specifically 'expect')
A

const { expect } = require(‘chai’);

(const { toBeTested } = require(‘.’) ) imports index.js

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

basic chai structure

A
describe("function", () => {
    it("does something", ()=>{
      ... setup ...
      expect(function(x)).to.equal("result");
    });
  });
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

chai for errors

A
needs anonymous function:
expect(() => functionBeingTested()).to.throw;
or
expect(() => functionBeingTested()).to.throw(TypeError/ReferenceError, 'error message')
How well did you know this?
1
Not at all
2
3
4
5
Perfectly