2021-01-11 12:13:41 -05:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
2020-03-05 05:52:18 -05:00
|
|
|
import { assertThrows, unitTest } from "./test_util.ts";
|
|
|
|
|
2021-08-05 07:08:58 -04:00
|
|
|
unitTest(function testFnOverloading() {
|
2020-03-05 05:52:18 -05:00
|
|
|
// just verifying that you can use this test definition syntax
|
2021-08-05 07:08:58 -04:00
|
|
|
Deno.test("test fn overloading", () => {});
|
2020-03-05 05:52:18 -05:00
|
|
|
});
|
|
|
|
|
2021-08-05 07:08:58 -04:00
|
|
|
unitTest(function nameOfTestCaseCantBeEmpty() {
|
2020-03-05 05:52:18 -05:00
|
|
|
assertThrows(
|
|
|
|
() => {
|
|
|
|
Deno.test("", () => {});
|
|
|
|
},
|
2020-03-15 05:34:24 -04:00
|
|
|
TypeError,
|
2020-07-14 15:24:17 -04:00
|
|
|
"The test name can't be empty",
|
2020-03-05 05:52:18 -05:00
|
|
|
);
|
|
|
|
assertThrows(
|
|
|
|
() => {
|
|
|
|
Deno.test({
|
|
|
|
name: "",
|
2020-03-28 13:03:49 -04:00
|
|
|
fn: () => {},
|
2020-03-05 05:52:18 -05:00
|
|
|
});
|
|
|
|
},
|
2020-03-15 05:34:24 -04:00
|
|
|
TypeError,
|
2020-07-14 15:24:17 -04:00
|
|
|
"The test name can't be empty",
|
2020-03-05 05:52:18 -05:00
|
|
|
);
|
|
|
|
});
|