std/testing
2019-01-03 14:16:15 -05:00
..
mod.ts Add testing module 2019-01-02 13:45:42 -05:00
README.md Add testing/README.md (#75) 2019-01-03 14:16:15 -05:00
test.ts Add testing module 2019-01-02 13:45:42 -05:00

Testing

Usage

import { test, assert, equal, assertEqual } from 'https://deno.land/x/testing/testing.ts';

test({
  name: 'testing example',
  fn() {
    assert(equal("world", "world"));
    assert(!equal("hello", "world"));
    assert(equal({ hello: "world" }, { hello: "world" }));
    assert(!equal({ world: "hello" }, { hello: "world" }));
    assertEqual("world", "world");
    assertEqual({hello: "world"}, {hello: "world"});
  },
});

Short syntax (named function instead of object):

test(function example() {
  assert(equal("world", "world"));
  assert(!equal("hello", "world"));
  assert(equal({ hello: "world" }, { hello: "world" }));
  assert(!equal({ world: "hello" }, { hello: "world" }));
  assertEqual("world", "world");
  assertEqual({hello: "world"}, {hello: "world"});
});