recreating-nodejs-test-runner

Node.js Custom Test Runner Experiment

Build Status

Introduction

This project is an experiment where I recreate the Node.js test runner using the same components. The primary goal is to understand and demonstrate the functionality of the test runner using:

Project Structure

Test Runner Components

This custom test runner follows all the steps a test runner needs to have:

Role of AsyncHooks

AsyncHooks are crucial for this project as they allow tracking the origin and retrieving the entire tree of tests. This helps in understanding which describe block all hooks belong to. Using AsyncHooks, the context of asynchronous operations is maintained, ensuring that hooks like before, after, beforeEach, and afterEach are correctly associated with their respective test cases.

Getting Started

Prerequisites

Ensure you have the following installed:

Installation

git clone https://github.com/ErickWendel/recreating-nodejs-test-runner.git

Complete app

cd recreating-nodejs-test-runner/app
docker-compose up -d
npm test

Test runner Example

Clone the repository and install the dependencies:

cd recreating-nodejs-test-runner/test-runner
npm test

Try at home!

See at the example and execute one of your applications there :)

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.

License

This project is licensed under the MIT License.


Todo