elsaland / elsa

❄️ Elsa is a minimal runtime for JavaScript and TypeScript written in Go
MIT License
2.8k stars 62 forks source link

feat(js/testing): add Elsa.tests - tiny test runner #80

Closed littledivy closed 4 years ago

littledivy commented 4 years ago

The test runner fulfills basic requirement for unit testing. Utilities like assert, etc should be a part of the std.

USAGE:

Elsa.tests({
  "adds numbers": function () {
    eq(6, add(2, 4));
    eq(6.6, add(2.6, 4));
  },

  "subtracts numbers": function () {
    eq(-2, add(2, -4));
  },

  "add fail": function () {
    eq(2, add(2, 1));
  },
});