1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-15 16:43:44 -05:00
denoland-deno/cli/tests/unit/progressevent_test.ts

19 lines
680 B
TypeScript
Raw Normal View History

// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
import { assertEquals, unitTest } from "./test_util.ts";
2020-08-11 08:00:53 -04:00
unitTest(function progressEventConstruct(): void {
const progressEventDefs = new ProgressEvent("progressEventType", {});
assertEquals(progressEventDefs.lengthComputable, false);
assertEquals(progressEventDefs.loaded, 0);
assertEquals(progressEventDefs.total, 0);
const progressEvent = new ProgressEvent("progressEventType", {
lengthComputable: true,
loaded: 123,
total: 456,
});
assertEquals(progressEvent.lengthComputable, true);
assertEquals(progressEvent.loaded, 123);
assertEquals(progressEvent.total, 456);
});