Skip to Content
Learning TypeScript 2.x - Second Edition
book

Learning TypeScript 2.x - Second Edition

by Remo H. Jansen
April 2018
Beginner content levelBeginner
536 pages
13h 21m
English
Packt Publishing
Content preview from Learning TypeScript 2.x - Second Edition

TDD versus BDD with Mocha and Chai

As we have already seen, TDD and BDD follow many of the same principles, but have some differences in their style. While these two styles provide the same functionality, BDD is considered to be easier to read by many developers.

The following table compares the naming and style of the suites, tests, and assertions used by the TDD and BBD styles:

TDD

BDD

suite

describe

setup

before

teardown

after

suiteSetup

beforeEach

suiteTeardown

afterEach

test

it

assert.equal(math.PI, 3.14159265359);

expect(math.PI).to.equals(3.14159265359);

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering TypeScript - Fourth Edition

Mastering TypeScript - Fourth Edition

Nathan Rozentals
Learning TypeScript

Learning TypeScript

Josh Goldberg
TypeScript for Beginners

TypeScript for Beginners

Bharath Thippireddy

Publisher Resources

ISBN: 9781788391474Supplemental Content