@opencreek/ext
Advanced tools
Comparing version 2.7.1 to 2.7.2--canary.35.7275004788.0
@@ -18,3 +18,3 @@ "use strict"; | ||
const latestTask = this.tasks[this.tasks.length - 1]; | ||
if (latestTask?.elapsed === undefined) { | ||
if (latestTask != null && latestTask?.elapsed == null) { | ||
this.stop(); | ||
@@ -29,3 +29,3 @@ } | ||
const latestTask = this.tasks[this.tasks.length - 1]; | ||
if (latestTask?.elapsed === undefined) { | ||
if (latestTask != null && latestTask?.elapsed == null) { | ||
latestTask.elapsed = new Date().valueOf() - latestTask.start; | ||
@@ -32,0 +32,0 @@ } |
@@ -21,2 +21,15 @@ "use strict"; | ||
}); | ||
(0, ava_1.default)("StopWatch should be able to be started later", async (t) => { | ||
const sw = new StopWatch_1.StopWatch(); | ||
sw.start("1"); | ||
await (0, sleep_1.sleep)(1000); | ||
sw.start("2"); | ||
await (0, sleep_1.sleep)(1500); | ||
sw.start("3"); | ||
await (0, sleep_1.sleep)(100); | ||
sw.stop(); | ||
t.is(sw.tasks.length, 3); | ||
t.true(sw.toString() !== ""); | ||
console.log(sw.toString()); | ||
}); | ||
//# sourceMappingURL=StopWatch.test.js.map |
{ | ||
"name": "@opencreek/ext", | ||
"version": "2.7.1", | ||
"version": "2.7.2--canary.35.7275004788.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -18,1 +18,16 @@ import test from "ava" | ||
}) | ||
test("StopWatch should be able to be started later", async (t) => { | ||
const sw = new StopWatch() | ||
sw.start("1") | ||
await sleep(1000) | ||
sw.start("2") | ||
await sleep(1500) | ||
sw.start("3") | ||
await sleep(100) | ||
sw.stop() | ||
t.is(sw.tasks.length, 3) | ||
t.true(sw.toString() !== "") | ||
console.log(sw.toString()) | ||
}) |
@@ -25,3 +25,3 @@ import { tableToString } from "./table" | ||
const latestTask = this.tasks[this.tasks.length - 1] | ||
if (latestTask?.elapsed === undefined) { | ||
if (latestTask != null && latestTask?.elapsed == null) { | ||
this.stop() | ||
@@ -38,3 +38,3 @@ } | ||
const latestTask = this.tasks[this.tasks.length - 1] | ||
if (latestTask?.elapsed === undefined) { | ||
if (latestTask != null && latestTask?.elapsed == null) { | ||
latestTask.elapsed = new Date().valueOf() - latestTask.start | ||
@@ -41,0 +41,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
236600
4274
2