Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not a Kata, just a little workflow improvement #41

Open
simon-tiger opened this issue Jun 4, 2020 · 0 comments
Open

Not a Kata, just a little workflow improvement #41

simon-tiger opened this issue Jun 4, 2020 · 0 comments

Comments

@simon-tiger
Copy link

simon-tiger commented Jun 4, 2020

Here's a simple test library I made to run with Quokka, so that you don't have to replace Test.assertEquals with console.log. It uses the colors node package:

const colors = require("colors");

const Test = {
  describe: name => {
    console.log(name);
  },
  expect: condition => {
    if (condition) {
      console.log(colors.green("Test Passed"));
    } else {
      console.log(colors.red("Test Failed"));
    }
  },
  assertEquals: (a, b) => {
    if (a === b) {
      console.log(colors.green(`Test Passed: Value == ${a}`));
    } else {
      console.log(colors.red(`Expected: ${b}, instead got: ${a}`));
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant