Last active
November 8, 2017 23:53
-
-
Save jukben/beb0f148b87a58d1fca65874b6bbb8fd to your computer and use it in GitHub Desktop.
We had to mock Chalk for CI – Proxy FTW
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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