Skip to content

Commit

Permalink
improve check
Browse files Browse the repository at this point in the history
for easier debugging
  • Loading branch information
mifi committed Oct 5, 2024
1 parent d7409c9 commit abe0d9d
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions test/integration/live-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ async function createVirtualTestServer(handler: RequestListener): Promise<Virtua
}
}

describe('API integration', { timeout: 30000 }, () => {
describe('API integration', { timeout: 60000 }, () => {
describe('assembly creation', () => {
it('should create a retrievable assembly on the server', async () => {
const client = createClient()
Expand Down Expand Up @@ -280,25 +280,27 @@ describe('API integration', { timeout: 30000 }, () => {
original_md5hash: '1b199e02dd833b2278ce2a0e75480b14',
})
// Because order is not same as input
const uploadsKeyed = Object.fromEntries(result.uploads.map((upload) => [upload.name, upload]))
expect(uploadsKeyed.file1).toMatchObject(getMatchObject({ name: 'file1' }))
expect(uploadsKeyed.file2).toMatchObject(getMatchObject({ name: 'file2' }))
expect(uploadsKeyed.file3).toMatchObject(getMatchObject({ name: 'file3' }))
expect(uploadsKeyed.file4).toMatchObject({
name: 'file4',
basename: 'file4',
ext: 'jpg',
size: 133788,
mime: 'image/jpeg',
type: 'image',
field: 'file4',
md5hash: '42f29c0d9d5f3ea807ef3c327f8c5890',
original_basename: 'file4',
original_name: 'file4',
original_path: '/',
original_md5hash: '42f29c0d9d5f3ea807ef3c327f8c5890',
})
})
const uploadsMap = Object.fromEntries(result.uploads.map((upload) => [upload.name, upload]))
expect(uploadsMap).toEqual({
file1: expect.objectContaining(getMatchObject({ name: 'file1' })),
file2: expect.objectContaining(getMatchObject({ name: 'file2' })),
file3: expect.objectContaining(getMatchObject({ name: 'file3' })),
file4: expect.objectContaining({
name: 'file4',
basename: 'file4',
ext: 'jpg',
size: 133788,
mime: 'image/jpeg',
type: 'image',
field: 'file4',
md5hash: '42f29c0d9d5f3ea807ef3c327f8c5890',
original_basename: 'file4',
original_name: 'file4',
original_path: '/',
original_md5hash: '42f29c0d9d5f3ea807ef3c327f8c5890',
}),
});
});

it('should allow setting an explicit assemblyId on createAssembly', async () => {
const client = createClient()
Expand Down

0 comments on commit abe0d9d

Please sign in to comment.