summaryrefslogtreecommitdiff
path: root/cli/tests/unit/progressevent_test.ts
blob: 4d6b4c08f88fecf828800520046d967fc4e9d9d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
import { assertEquals, unitTest } from "./test_util.ts";

unitTest(function progressEventConstruct() {
  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);
});