Skip to content

Commit 35ffbde

Browse files
committed
Add new test
1 parent 382bbfb commit 35ffbde

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

glean/tests/core/pings/index.spec.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ describe("PingType", function() {
236236
await assert.rejects(p);
237237
});
238238

239-
it("runs a validator: sorry", async function() {
239+
it("the validator is not affected by recordings after submit", async function() {
240240
const ping = new PingType({
241241
name: "custom",
242242
includeClientId: true,
@@ -253,25 +253,19 @@ describe("PingType", function() {
253253
});
254254

255255
let validatorRun = false;
256+
const TEST_NUM_ADDITIONS = 100;
256257

257258
const p = ping.testBeforeNextSubmit(async () => {
258-
await new Promise<void>(resolve => {
259-
setTimeout(() => resolve(), 100);
260-
});
259+
await new Promise(r => setTimeout(r, 100));
260+
261261
const value = await counter.testGetValue();
262-
console.log("!!!", value);
263-
assert.strictEqual(value, 100);
262+
assert.notStrictEqual(value, TEST_NUM_ADDITIONS);
264263
validatorRun = true;
265264
});
266265
ping.submit("test");
267266

268-
for (let i = 0; i < 100; i++) {
267+
for (let i = 0; i < TEST_NUM_ADDITIONS; i++) {
269268
counter.add();
270-
Context.dispatcher.launch(async () => {
271-
await new Promise<void>(resolve => {
272-
setTimeout(() => resolve(), 10);
273-
});
274-
});
275269
}
276270

277271
await p;

0 commit comments

Comments
 (0)