Skip to content

Commit 583411e

Browse files
committed
Update test utils
1 parent 6d291c7 commit 583411e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

glean/tests/utils.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { JSONObject } from "../src/core/utils";
88
import { isString } from "../src/core/utils";
99
import Uploader from "../src/core/upload/uploader";
1010
import { UploadResultStatus, UploadResult } from "../src/core/upload/uploader";
11-
import Glean from "../src/core/glean/async.js";
11+
import Glean from "../src/core/glean.js";
1212

1313
/**
1414
* Decoded, unzips and parses the ping payload into a JSON object.
@@ -29,11 +29,17 @@ export function unzipPingPayload(payload: Uint8Array | string): JSONObject {
2929

3030
/**
3131
* Disables the uploading on the Glean singleton,
32-
* so that it doesn't interefe with tests.
32+
* so that it doesn't interfere with tests.
3333
*/
3434
export function stopGleanUploader(): void {
35-
// eslint-disable-next-line @typescript-eslint/no-empty-function
36-
Glean.pingUploader["worker"]["work"] = () => {};
35+
Glean.pingUploader.blockUploads();
36+
}
37+
38+
/**
39+
* Enables the uploading on the Glean singleton.
40+
*/
41+
export function resumeGleanUploader(): void {
42+
Glean.pingUploader.resumeUploads();
3743
}
3844

3945
/**

0 commit comments

Comments
 (0)