MCPcopy Create free account
hub / github.com/OneNoteDev/WebClipper / runTests

Function runTests

src/tests/testModule.ts:11–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 protected abstract tests(): void;
10
11 public runTests(): void {
12 let beforeEach = this.beforeEach.bind(this);
13 let resetFrontEndStorage = this.resetFrontEndStorage.bind(this);
14
15 let afterEach = this.afterEach.bind(this);
16
17 // We call the implemented beforeEach/afterEach after the common functionality
18 // as it's a higher priority, and we don't want to override it
19 QUnit.module(this.module(), {
20 beforeEach: () => {
21 resetFrontEndStorage();
22 beforeEach();
23 },
24 afterEach: () => {
25 // Unfortunately, we have some code that makes use of static, which
26 // means that we might end up polluting other test modules if we don't
27 // reset things. We declare these here so the developer doesn't have
28 // to remember to do this in their modules.
29 Settings.setSettingsJsonForTesting(undefined);
30 Localization.setLocalizedStrings(undefined);
31
32 afterEach();
33 }
34 });
35
36 this.tests();
37 }
38
39 // Overridable
40 protected beforeEach() { }

Callers

nothing calls this directly

Calls 5

resetFrontEndStorageFunction · 0.85
beforeEachFunction · 0.85
afterEachFunction · 0.85
moduleMethod · 0.45
testsMethod · 0.45

Tested by

no test coverage detected