Skip to content

A library to ease refactoring as per the golden master method; integrates seamlessly with Jest.

License

Notifications You must be signed in to change notification settings

mathieueveillard/jest-golden-master

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jest-golden-master

What is it?

jest-golden-master helps writing tests as per the Golden Master refactoring method ⚙️ 🧰 🔧

How does it work?

jest-golden-master monckey-patches the native console.log method 🙉 🙈

Getting started

npm install -D jest-golden-master

jest-golden-master exports a single runGoldenMaster function to be used within a test. This way, the library seamlessly integrates with Jest 🫶 💙

import runGoldenMaster from "jest-golden-master";

test("Test name", async () => {
  await runGoldenMaster(async () => {
    // Write your scenario here
    // Meaning: invoke the legacy codebase's API
    // All `console.log`s will be logged as per the Golden Master standards
  });
});

About

A library to ease refactoring as per the golden master method; integrates seamlessly with Jest.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published