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