creativehelpers
v1.0.3
Published
A package of handy tools that help in creative coding
Maintainers
Readme
consoletester
The tiniest test framework, just for the console
Why?
Every week in the rendezvous with cassidoo newsletter there is a coding challenge. It's nice to have tiny tester ready to see if you can meet the challenge!
Useage
You pass two arguements, one, your expected result, and the second your current test. consoletester will then return both variables in the console (handy to compare) and a stringified comparison of equality.
const expected = true;
const attempt = true;
consoletester(expected, attempt)
// {expected:...}, {result:...}
// success
const expected = true;
const attempt = false;
consoletester(expected, attempt)
// {expected:...}, {result:...}
// failYou can even pass in arrays or objects
const expected = { name: "Testy McTesterson"};
const attempt = { name: "Testy McTesterson"};
consoletester(expected, attempt)
// {expected:...}, {result:...}
// success const expected = { name: "Testy McTesterson"};
const attempt = { name: "Wrongy McFalserson"};
consoletester(expected, attempt)
// {expected:...}, {result:...}
// failCodePen template
Wanna just get coding? There is a CodePen tempalte ready to start working on the lastest challenge!
