elsaland / elsa

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

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

Closed littledivy closed 3 years ago

littledivy commented 3 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));
  },
});