mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-26 17:07:21 +02:00
Merge pull request #21633 from Snuffleupagus/test-toBeUndefined
Use the `toBeUndefined()` matcher consistently in the unit tests
This commit is contained in:
commit
dd41cd487d
@ -2698,7 +2698,7 @@ describe("api", function () {
|
|||||||
|
|
||||||
expect(info.Title).toEqual("Basic API Test");
|
expect(info.Title).toEqual("Basic API Test");
|
||||||
// Custom, non-standard, information dictionary entries.
|
// Custom, non-standard, information dictionary entries.
|
||||||
expect(info.Custom).toEqual(undefined);
|
expect(info.Custom).toBeUndefined();
|
||||||
// The following are PDF.js specific, non-standard, properties.
|
// The following are PDF.js specific, non-standard, properties.
|
||||||
expect(info.PDFFormatVersion).toEqual("1.7");
|
expect(info.PDFFormatVersion).toEqual("1.7");
|
||||||
expect(info.Language).toEqual("en");
|
expect(info.Language).toEqual("en");
|
||||||
@ -2757,7 +2757,7 @@ describe("api", function () {
|
|||||||
await pdfDoc.getMetadata();
|
await pdfDoc.getMetadata();
|
||||||
|
|
||||||
// Custom, non-standard, information dictionary entries.
|
// Custom, non-standard, information dictionary entries.
|
||||||
expect(info.Custom).toEqual(undefined);
|
expect(info.Custom).toBeUndefined();
|
||||||
// The following are PDF.js specific, non-standard, properties.
|
// The following are PDF.js specific, non-standard, properties.
|
||||||
expect(info.PDFFormatVersion).toBeNull();
|
expect(info.PDFFormatVersion).toBeNull();
|
||||||
expect(info.Language).toBeNull();
|
expect(info.Language).toBeNull();
|
||||||
@ -2784,7 +2784,7 @@ describe("api", function () {
|
|||||||
await pdfDoc.getMetadata();
|
await pdfDoc.getMetadata();
|
||||||
|
|
||||||
// Custom, non-standard, information dictionary entries.
|
// Custom, non-standard, information dictionary entries.
|
||||||
expect(info.Custom).toEqual(undefined);
|
expect(info.Custom).toBeUndefined();
|
||||||
// The following are PDF.js specific, non-standard, properties.
|
// The following are PDF.js specific, non-standard, properties.
|
||||||
expect(info.PDFFormatVersion).toEqual("1.6");
|
expect(info.PDFFormatVersion).toEqual("1.6");
|
||||||
expect(info.Language).toBeNull();
|
expect(info.Language).toBeNull();
|
||||||
|
|||||||
@ -26,7 +26,7 @@ describe("event_utils", function () {
|
|||||||
const eventBus = new EventBus();
|
const eventBus = new EventBus();
|
||||||
let count = 0;
|
let count = 0;
|
||||||
eventBus.on("test", function (evt) {
|
eventBus.on("test", function (evt) {
|
||||||
expect(evt).toEqual(undefined);
|
expect(evt).toBeUndefined();
|
||||||
count++;
|
count++;
|
||||||
});
|
});
|
||||||
eventBus.dispatch("test");
|
eventBus.dispatch("test");
|
||||||
@ -204,7 +204,7 @@ describe("event_utils", function () {
|
|||||||
const eventBus = new EventBus();
|
const eventBus = new EventBus();
|
||||||
let count = 0;
|
let count = 0;
|
||||||
eventBus.on("test", function (evt) {
|
eventBus.on("test", function (evt) {
|
||||||
expect(evt).toEqual(undefined);
|
expect(evt).toBeUndefined();
|
||||||
count++;
|
count++;
|
||||||
});
|
});
|
||||||
function domEventListener() {
|
function domEventListener() {
|
||||||
|
|||||||
@ -80,7 +80,7 @@ describe("message_handler", function () {
|
|||||||
|
|
||||||
await sleep(10);
|
await sleep(10);
|
||||||
result = await reader.read();
|
result = await reader.read();
|
||||||
expect(result.value).toEqual(undefined);
|
expect(result.value).toBeUndefined();
|
||||||
expect(result.done).toEqual(true);
|
expect(result.done).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ describe("message_handler", function () {
|
|||||||
expect(log).toEqual("01p2p");
|
expect(log).toEqual("01p2p");
|
||||||
|
|
||||||
result = await reader.read();
|
result = await reader.read();
|
||||||
expect(result.value).toEqual(undefined);
|
expect(result.value).toBeUndefined();
|
||||||
expect(result.done).toEqual(true);
|
expect(result.done).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ describe("message_handler", function () {
|
|||||||
expect(log).toEqual("012p");
|
expect(log).toEqual("012p");
|
||||||
|
|
||||||
result = await reader.read();
|
result = await reader.read();
|
||||||
expect(result.value).toEqual(undefined);
|
expect(result.value).toBeUndefined();
|
||||||
expect(result.done).toEqual(true);
|
expect(result.done).toEqual(true);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -381,7 +381,7 @@ describe("message_handler", function () {
|
|||||||
expect(log).toEqual("01");
|
expect(log).toEqual("01");
|
||||||
|
|
||||||
result = await reader.read();
|
result = await reader.read();
|
||||||
expect(result.value).toEqual(undefined);
|
expect(result.value).toBeUndefined();
|
||||||
expect(result.done).toEqual(true);
|
expect(result.done).toEqual(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -324,7 +324,7 @@ describe("XFAParser", function () {
|
|||||||
expect(font.weight).toEqual("bold");
|
expect(font.weight).toEqual("bold");
|
||||||
expect(font.posture).toEqual("italic");
|
expect(font.posture).toEqual("italic");
|
||||||
expect(font.fill.color.value).toEqual({ r: 1, g: 2, b: 3 });
|
expect(font.fill.color.value).toEqual({ r: 1, g: 2, b: 3 });
|
||||||
expect(font.extras).toEqual(undefined);
|
expect(font.extras).toBeUndefined();
|
||||||
|
|
||||||
font = root.template.subform.field[1].font;
|
font = root.template.subform.field[1].font;
|
||||||
expect(font.typeface).toEqual("Foo");
|
expect(font.typeface).toEqual("Foo");
|
||||||
@ -374,7 +374,7 @@ describe("XFAParser", function () {
|
|||||||
expect(font.weight).toEqual("bold");
|
expect(font.weight).toEqual("bold");
|
||||||
expect(font.posture).toEqual("italic");
|
expect(font.posture).toEqual("italic");
|
||||||
expect(font.fill.color.value).toEqual({ r: 1, g: 2, b: 3 });
|
expect(font.fill.color.value).toEqual({ r: 1, g: 2, b: 3 });
|
||||||
expect(font.extras).toEqual(undefined);
|
expect(font.extras).toBeUndefined();
|
||||||
|
|
||||||
font = root.template.subform.field[1].font;
|
font = root.template.subform.field[1].font;
|
||||||
expect(font.typeface).toEqual("Foo");
|
expect(font.typeface).toEqual("Foo");
|
||||||
@ -943,7 +943,7 @@ describe("XFAParser", function () {
|
|||||||
).toBe("Spratt");
|
).toBe("Spratt");
|
||||||
expect(
|
expect(
|
||||||
searchNode(form, form, "registration.apt..text")[0][$dump]().$content
|
searchNode(form, form, "registration.apt..text")[0][$dump]().$content
|
||||||
).toBe(undefined);
|
).toBeUndefined();
|
||||||
expect(
|
expect(
|
||||||
searchNode(form, form, "registration.street..text")[0][$dump]().$content
|
searchNode(form, form, "registration.street..text")[0][$dump]().$content
|
||||||
).toBe("99 Candlestick Lane");
|
).toBe("99 Candlestick Lane");
|
||||||
@ -1003,7 +1003,7 @@ describe("XFAParser", function () {
|
|||||||
).toBe("Spratt");
|
).toBe("Spratt");
|
||||||
expect(
|
expect(
|
||||||
searchNode(form, form, "registration..apt..text")[0][$dump]().$content
|
searchNode(form, form, "registration..apt..text")[0][$dump]().$content
|
||||||
).toBe(undefined);
|
).toBeUndefined();
|
||||||
expect(
|
expect(
|
||||||
searchNode(form, form, "registration..street..text")[0][$dump]()
|
searchNode(form, form, "registration..street..text")[0][$dump]()
|
||||||
.$content
|
.$content
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user