Skip to content

Instantly share code, notes, and snippets.

@jukben
Last active November 8, 2017 23:53
Show Gist options
  • Save jukben/beb0f148b87a58d1fca65874b6bbb8fd to your computer and use it in GitHub Desktop.
Save jukben/beb0f148b87a58d1fca65874b6bbb8fd to your computer and use it in GitHub Desktop.
We had to mock Chalk for CI – Proxy FTW
/**
* Chalk mock for CI
*
* chalk.whatever.color.red("text") => "text"
* chalk.i.have.to.go.sleep("NOW!)" => "NOW!"
*/
module.exports = new Proxy(
{},
{
get: function get() {
return new Proxy(() => {}, {
get,
apply: (target, that, [text]) => text,
});
},
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment