mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -0,0 +1,41 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
"use strict";
|
||||
|
||||
const { getRepeatId } = require("devtools/client/webconsole/new-console-output/utils/messages");
|
||||
const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index");
|
||||
|
||||
const expect = require("expect");
|
||||
|
||||
describe("getRepeatId:", () => {
|
||||
it("returns same repeatId for duplicate values", () => {
|
||||
const message1 = stubPreparedMessages.get("console.log('foobar', 'test')");
|
||||
const message2 = message1.set("repeat", 3);
|
||||
expect(getRepeatId(message1)).toEqual(getRepeatId(message2));
|
||||
});
|
||||
|
||||
it("returns different repeatIds for different values", () => {
|
||||
const message1 = stubPreparedMessages.get("console.log('foobar', 'test')");
|
||||
const message2 = message1.set("parameters", ["funny", "monkey"]);
|
||||
expect(getRepeatId(message1)).toNotEqual(getRepeatId(message2));
|
||||
});
|
||||
|
||||
it("returns different repeatIds for different severities", () => {
|
||||
const message1 = stubPreparedMessages.get("console.log('foobar', 'test')");
|
||||
const message2 = message1.set("level", "error");
|
||||
expect(getRepeatId(message1)).toNotEqual(getRepeatId(message2));
|
||||
});
|
||||
|
||||
it("handles falsy values distinctly", () => {
|
||||
const messageNaN = stubPreparedMessages.get("console.log(NaN)");
|
||||
const messageUnd = stubPreparedMessages.get("console.log(undefined)");
|
||||
const messageNul = stubPreparedMessages.get("console.log(null)");
|
||||
|
||||
const repeatIds = new Set([
|
||||
getRepeatId(messageNaN),
|
||||
getRepeatId(messageUnd),
|
||||
getRepeatId(messageNul)]
|
||||
);
|
||||
expect(repeatIds.size).toEqual(3);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue