Fixed tests for fields getters (seems like that native error messages can change)

This commit is contained in:
Alexander Cerutti
2021-11-14 00:43:07 +01:00
parent 964be0802c
commit f430bf1515

View File

@@ -463,26 +463,11 @@ describe("PKPass", () => {
describe("fields getters", () => { describe("fields getters", () => {
it("should throw error if a type has not been defined", () => { it("should throw error if a type has not been defined", () => {
expect(() => pass.primaryFields).toThrowError( expect(() => pass.primaryFields).toThrowError(TypeError);
TypeError, expect(() => pass.secondaryFields).toThrowError(TypeError);
"Cannot read properties of undefined (reading 'primaryFields')", expect(() => pass.auxiliaryFields).toThrowError(TypeError);
); expect(() => pass.headerFields).toThrowError(TypeError);
expect(() => pass.secondaryFields).toThrowError( expect(() => pass.backFields).toThrowError(TypeError);
TypeError,
"Cannot read properties of undefined (reading 'secondaryFields')",
);
expect(() => pass.auxiliaryFields).toThrowError(
TypeError,
"Cannot read properties of undefined (reading 'auxiliaryFields')",
);
expect(() => pass.headerFields).toThrowError(
TypeError,
"Cannot read properties of undefined (reading 'headerFields')",
);
expect(() => pass.backFields).toThrowError(
TypeError,
"Cannot read properties of undefined (reading 'backFields')",
);
}); });
it("should return an instance of FieldsArray if a type have been set", () => { it("should return an instance of FieldsArray if a type have been set", () => {