Skip to content

Commit

Permalink
fix jest test and get_urls logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Jan 3, 2020
1 parent 8cee174 commit 91af0bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test(`fails if no URL is passed`, async () => {
server: mockServer,
} as FullUrlsOpts)
).rejects.toMatchInlineSnapshot(
`[Error: No valid URL fields found in Job Params! Expected \`job.relativeUrl\` or \`job.objects[{ relativeUrl }]\`]`
`[Error: No valid URL fields found in Job Params! Expected \`job.relativeUrl: string\` or \`job.relativeUrls: string[]\`]`
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function getFullUrls<JobDocPayloadType>({
relativeUrls = job.relativeUrls;
} else {
throw new Error(
`No valid URL fields found in Job Params! Expected \`job.relativeUrl\` or \`job.objects[{ relativeUrl }]\``
`No valid URL fields found in Job Params! Expected \`job.relativeUrl: string\` or \`job.relativeUrls: string[]\``
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ beforeEach(() => {
'server.port': 5601,
};
mockServer = {
expose: () => {},
expose: jest.fn(),
log: jest.fn(),
config: memoize(() => ({ get: jest.fn() })),
info: {
protocol: 'http',
Expand Down Expand Up @@ -71,7 +72,7 @@ test(`passes browserTimezone to generatePdf`, async () => {
const browserTimezone = 'UTC';
await executeJob(
'pdfJobId',
{ objects: [], browserTimezone, headers: encryptedHeaders },
{ relativeUrls: [], browserTimezone, headers: encryptedHeaders },
cancellationToken
);

Expand Down

0 comments on commit 91af0bc

Please sign in to comment.