From 046467ff473f7ca5ebec5a4b1ad1b1c1bb9d7efe Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Wed, 14 Apr 2021 22:11:45 +0200 Subject: [PATCH] Drop obsolete done callbacks in `test/unit/annotation_storage_spec.js` There is no asynchronous code involved here, so we can get rid of all done callbacks here and simply use the fact that if the function call ends without failed assertion that the test passed. --- test/unit/annotation_storage_spec.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/unit/annotation_storage_spec.js b/test/unit/annotation_storage_spec.js index 8ba4ee15e..ee50d45bb 100644 --- a/test/unit/annotation_storage_spec.js +++ b/test/unit/annotation_storage_spec.js @@ -17,7 +17,7 @@ import { AnnotationStorage } from "../../src/display/annotation_storage.js"; describe("AnnotationStorage", function () { describe("GetOrDefaultValue", function () { - it("should get and set a new value in the annotation storage", function (done) { + it("should get and set a new value in the annotation storage", function () { const annotationStorage = new AnnotationStorage(); let value = annotationStorage.getValue("123A", { value: "hello world", @@ -34,20 +34,18 @@ describe("AnnotationStorage", function () { value: "an other string", }).value; expect(value).toEqual("hello world"); - done(); }); }); describe("SetValue", function () { - it("should set a new value in the annotation storage", function (done) { + it("should set a new value in the annotation storage", function () { const annotationStorage = new AnnotationStorage(); annotationStorage.setValue("123A", { value: "an other string" }); const value = annotationStorage.getAll()["123A"].value; expect(value).toEqual("an other string"); - done(); }); - it("should call onSetModified() if value is changed", function (done) { + it("should call onSetModified() if value is changed", function () { const annotationStorage = new AnnotationStorage(); let called = false; const callback = function () { @@ -66,12 +64,11 @@ describe("AnnotationStorage", function () { called = false; annotationStorage.setValue("asdf", { value: "modified" }); expect(called).toBe(false); - done(); }); }); describe("ResetModified", function () { - it("should call onResetModified() if set", function (done) { + it("should call onResetModified() if set", function () { const annotationStorage = new AnnotationStorage(); let called = false; const callback = function () { @@ -92,7 +89,6 @@ describe("AnnotationStorage", function () { annotationStorage.setValue("asdf", { value: "modified" }); annotationStorage.resetModified(); expect(called).toBe(true); - done(); }); }); });