更新时间:2021-07-23 20:52:45
coverpage
Learning Behavior-driven Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. Welcome to BDD
The test-first approach
BDD versus TDD
Exploring unit testing
The structure of a test
What is a good test?
Summary
Chapter 2. Automating Tests with Mocha Chai and Sinon
Node and NPM as development platforms
Configuring your project with NPM
Introducing Mocha
More expressive assertions with Chai
Red/Green/Refactor
Test doubles with Sinon
Chapter 3. Writing BDD Features
Introducing myCafé
Writing features
Testing asynchronous features
Organizing our test code
Finishing our feature
Chapter 4. Cucumber.js and Gherkin
Getting started with Gherkin and Cucumber.js
Writing advanced scenarios
Useful Cucumber.js features
Cucumber.js or Mocha?
Chapter 5. Testing a REST Web API
The approach
Testing the GET order feature
Testing slave resources
Chapter 6. Testing a UI Using WebDriverJS
Our strategy for UI testing
WebDriverJS
Testing a rich Internet application
Chapter 7. The Page Object Pattern
Introducing the Page Object pattern
A page object for a rich UI
Chapter 8. Testing in Several Browsers with Protractor and WebDriver
Testing in several browsers with WebDriver
Welcome Protractor!
Chapter 9. Testing Against External Systems
Writing good test doubles
Testing against external systems
Chapter 10. Final Thoughts
TDD versus BDD
A roadmap to BDD
Concluding the book
Next steps?
Index