{"product_id":"build-your-own-test-framework-9781484292464","title":"Build Your Own Test Framework","description":"\u003cb\u003eBook Synopsis\u003c\/b\u003e\u003cbr\u003e\u003cdiv\u003eLearn to write better automated tests that will dramatically increase your productivity and have fun while doing so. This book is a build-your-own adventure designed for individual reading and for collaborative workshops. \u003c\/div\u003e\u003cdiv\u003e\u003cbr\u003e\u003c\/div\u003e\u003cdiv\u003eYou will build an xUnit automated test framework using JavaScript: initially a clone of Jest, but adding a couple of neat features borrowed from RSpec, the genre-defining tool for behavior-driven development (BDD). Along the way, you will explore the philosophy behind automated testing best practices. The automated test runner is one of the most important innovations within software engineering. But for many programmers, automated testing remains a mystery, and knowing how to write good tests is akin to sorcery.\u003cdiv\u003e\n\u003cbr\u003e\u003cdiv\u003eAs the chapters of this book unfold, you will see how the humble test runner is an elegant and simple piece of software. Each chapter picks a single feature to build, like the it function or the beforeEach \u003cbr\u003e\u003cbr\u003e\u003cb\u003eTable of Contents\u003c\/b\u003e\u003cbr\u003e\u003cb\u003ePart 1: Building the Core of a Test Framework \u003c\/b\u003eIn this part we build a barebones implementation of a test runner.\u003cb\u003eChapter 1: Creating an NPM Package of My Very Own, \u003c\/b\u003eYou will create a new NPM package for concise-test, including an entry-point for the test runner.\u003cbr\u003e\u003cb\u003eChapter 2: Building it to Define a Test\u003c\/b\u003ewe’ll implement the it function for defining tests, and start printing out some useful test run information on screen.\u003cbr\u003e\u003cb\u003eChapter 3: Grouping Tests with Describe, \u003c\/b\u003ewe’ll add support for grouping tests with the describe function, and we’ll continue to build out test reporting on screen. \u003cbr\u003e\u003cb\u003eChapter 4: Promoting Conciseness with BeforeEach and AfterEach\u003c\/b\u003eWe continue our quest for concise testing facilities with the addition of beforeEach and afterEach functions. \u003cbr\u003e\u003cb\u003eChapter 5: Improving Legibility with Expect, \u003c\/b\u003eWe finish off the core of our API by building an abstraction over throw new Error. \u003cbr\u003e\u003cb\u003ePart 2: Constructing a Usable Framework \u003c\/b\u003eIn this part we add features that you’ll use on a daily basis. \u003cbr\u003e\u003cb\u003eChapter 6: Formatting Expectation Errors\u003c\/b\u003eWe write a formatter for stack traces to help pinpoint failures quickly. \u003cbr\u003e\u003cb\u003eChapter 7. Automatically Discovering Test Files\u003c\/b\u003eWe’ll add test file discovery to our test runner, and add support for running a single file through a command line argument. \u003cbr\u003e\u003cb\u003eChapter 8: Focusing on Tests with It.Only and Describe.Only, \u003c\/b\u003eWe 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. \u003cbr\u003e\u003cb\u003eChapter 9: Supporting Asynchronous Tests, \u003c\/b\u003eWe add the ability to wait on tests that return Promise objects, and timing out tests with it.timesOutAfter. \u003cbr\u003e\u003cb\u003eChapter 10: Reporting\u003c\/b\u003ewe use a pub-sub model to build a plug-in system for reporters. \u003cbr\u003e\u003cb\u003ePart 3: Extending for Power Users \u003c\/b\u003eIn this part we continue to add advanced features. \u003cbr\u003e\u003cb\u003eChapter 11: Sharing Behavior with it.BehavesLike, \u003c\/b\u003eWe borrow an important feature from Ruby: inheritance for describe blocks, which gives us a flexible mechanism for removing duplication between test groups. \u003cbr\u003e\u003cb\u003eChapter 12: Tagging Tests \u003c\/b\u003eWe create a mechanism for running a group of tests based on their tag. \u003cbr\u003e\u003cb\u003eChapter 13 : Skipping Tests \u003c\/b\u003ewe introduce a number of ways to skip tests, including tests without bodies, and it.skip plus describe.skip functions. \u003cbr\u003e\u003cb\u003eChapter 14 : Randomizing Tests\u003c\/b\u003eWe add a runtime flag for randomizing the order of tests, which is a useful technique for catching invisible dependencies between tests. \u003cbr\u003e\u003cb\u003ePart 4: Test Doubles and Mocks\u003c\/b\u003eChapter 15. Understanding test doubleswe create a function that can be used as a test spy and stub.\u003cbr\u003e\u003cb\u003eChapter 16. Module Mocks\u003c\/b\u003eWe create a system for mocking out entire modules, which is a useful technique when creating component doubles when testing React.\u003cbr\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e","brand":"APress","offers":[{"title":"Default Title","offer_id":48885832122711,"sku":"9781484292464","price":37.49,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0817\/1739\/5799\/files\/9781484292464.jpg?v=1722537855","url":"https:\/\/bookcurl.com\/products\/build-your-own-test-framework-9781484292464","provider":"Book Curl","version":"1.0","type":"link"}