2021-01-11 12:13:41 -05:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
2020-09-27 06:22:32 -04:00
|
|
|
import { assert, assertEquals, unitTest } from "./test_util.ts";
|
2020-04-11 11:42:02 -04:00
|
|
|
|
|
|
|
unitTest(function testDomError() {
|
|
|
|
const de = new DOMException("foo", "bar");
|
|
|
|
assert(de);
|
|
|
|
assertEquals(de.message, "foo");
|
|
|
|
assertEquals(de.name, "bar");
|
2021-01-09 01:27:46 -05:00
|
|
|
assertEquals(de.code, 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
unitTest(function testKnownDomException() {
|
|
|
|
const de = new DOMException("foo", "SyntaxError");
|
|
|
|
assert(de);
|
|
|
|
assertEquals(de.message, "foo");
|
|
|
|
assertEquals(de.name, "SyntaxError");
|
|
|
|
assertEquals(de.code, 12);
|
2020-04-11 11:42:02 -04:00
|
|
|
});
|