Skip to content

Commit

Permalink
fix: tests for typeguard changes (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolink authored May 31, 2024
1 parent a92c62f commit f2fff9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/cf-definitions-builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ describe('A Contentful definitions builder', () => {
export type TypeSysId = Entry<TypeSysIdFields>;
export function isTypeSysId(entry: WithContentTypeLink): entry is TypeSysId {
return entry.sys.contentType.sys.id === 'sysId'
return entry?.sys?.contentType?.sys?.id === 'sysId'
}
export type WithContentTypeLink = { sys: { contentType: { sys: { id: string } } } };
Expand Down
2 changes: 1 addition & 1 deletion test/renderer/type/type-guard-renderer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('A content type type guard renderer class', () => {
export type TypeAnimal = Entry<TypeAnimalFields>;
export function isTypeAnimal(entry: WithContentTypeLink): entry is TypeAnimal {
return entry.sys.contentType.sys.id === 'animal'
return entry?.sys?.contentType?.sys?.id === 'animal'
}
`),
);
Expand Down

0 comments on commit f2fff9e

Please sign in to comment.