Skip to content

Commit

Permalink
Await save storage, and use location returned in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dac09 committed Sep 6, 2024
1 parent ebc013a commit 34fec9b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions packages/storage/src/__tests__/resultExtensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,25 @@ describe('Result extensions', () => {

it('Generates data uris for each upload field', async () => {
// Save these files to disk
memStorage.save(new File(['SOFT_KITTENS'], 'first.txt'), {
fileName: 'first.txt',
path: '/dumbo',
})
memStorage.save(new File(['PURR_PURR'], 'second.txt'), {
fileName: 'second.txt',
path: '/dumbo',
})
const { location: firstUploadLocation } = await memStorage.save(
new File(['SOFT_KITTENS'], 'first.txt'),
{
fileName: 'first.txt',
path: '/dumbo',
},
)
const { location: secondUploadLocation } = await memStorage.save(
new File(['PURR_PURR'], 'second.txt'),
{
fileName: 'second.txt',
path: '/dumbo',
},
)

const dumbo = await prismaClient.dumbo.create({
data: {
firstUpload: '/dumbo/first.txt',
secondUpload: '/dumbo/second.txt',
firstUpload: firstUploadLocation,
secondUpload: secondUploadLocation,
},
})

Expand Down

0 comments on commit 34fec9b

Please sign in to comment.