Build Your Own Test Framework : Write Better Automated Tests, Implement Test Doubles and Mocks, and Increase Productivity
Build Your Own Test Framework : Write Better Automated Tests, Implement Test Doubles and Mocks, and Increase Productivity
Click to enlarge
Author(s): Irvine, Daniel
ISBN No.: 9781484292464
Pages: xxiv, 269
Year: 202303
Format: Trade Paper
Price: $ 87.84
Dispatch delay: Dispatched between 7 to 15 days
Status: Available

Part 1: Building the Core of a Test Framework In this part we build a barebones implementation of a test runner. Chapter 1: Creating an NPM Package of My Very Own, You will create a new NPM package for concise-test, including an entry-point for the test runner. Chapter 2: Building it to Define a Test we'll implement the it function for defining tests, and start printing out some useful test run information on screen. Chapter 3: Grouping Tests with Describe, we'll add support for grouping tests with the describe function, and we'll continue to build out test reporting on screen. Chapter 4: Promoting Conciseness with BeforeEach and AfterEach We continue our quest for concise testing facilities with the addition of beforeEach and afterEach functions. Chapter 5: Improving Legibility with Expect, We finish off the core of our API by building an abstraction over throw new Error. Part 2: Constructing a Usable Framework In this part we add features that you'll use on a daily basis. Chapter 6: Formatting Expectation Errors We write a formatter for stack traces to help pinpoint failures quickly.


Chapter 7. Automatically Discovering Test Files We'll add test file discovery to our test runner, and add support for running a single file through a command line argument. Chapter 8: Focusing on Tests with It.Only and Describe.Only, We split out runner into two phases: a discovery phase and an execution phase. In between them, we insert a filter phase to support running only a subset of phases. Chapter 9: Supporting Asynchronous Tests, We add the ability to wait on tests that return Promise objects, and timing out tests with it.timesOutAfter.


Chapter 10: Reporting we use a pub-sub model to build a plug-in system for reporters. Part 3: Extending for Power Users In this part we continue to add advanced features. Chapter 11: Sharing Behavior with it.BehavesLike, We borrow an important feature from Ruby: inheritance for describe blocks, which gives us a flexible mechanism for removing duplication between test groups. Chapter 12: Tagging Tests We create a mechanism for running a group of tests based on their tag. Chapter 13 : Skipping Tests we introduce a number of ways to skip tests, including tests without bodies, and it.skip plus describe.skip functions.


Chapter 14 : Randomizing Tests We add a runtime flag for randomizing the order of tests, which is a useful technique for catching invisible dependencies between tests. Part 4: Test Doubles and Mocks Chapter 15. Understanding test doubles we create a function that can be used as a test spy and stub. Chapter 16. Module Mocks We create a system for mocking out entire modules, which is a useful technique when creating component doubles when testing React.


To be able to view the table of contents for this publication then please subscribe by clicking the button below...
To be able to view the full description for this publication then please subscribe by clicking the button below...