Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: disable ESM to CJS transform in dist files #3773

Merged
merged 2 commits into from
May 30, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
No mocking with Jest and ESM
aduh95 committed May 30, 2022
commit 1d594382e936cdff52242481c2eff1f1a9e003e3
1 change: 0 additions & 1 deletion __mocks__/nanoid/non-secure.js

This file was deleted.

7 changes: 6 additions & 1 deletion packages/@uppy/core/src/Uppy.test.js
Original file line number Diff line number Diff line change
@@ -896,7 +896,12 @@ describe('src/Core', () => {
core.addFile({ source: 'jest', name: 'bar.jpg', type: 'image/jpeg', data: new Uint8Array() })
core.addFile({ source: 'file3', name: 'file3.jpg', type: 'image/jpeg', data: new Uint8Array() })

return expect(core.upload()).resolves.toMatchSnapshot()
// uploadID is random, we don't want randomness in the snapshot
const validateNanoID = r => (
typeof r.uploadID === 'string' && r.uploadID.length === 21 ? ({ ...r, uploadID: 'cjd09qwxb000dlql4tp4doz8h' }) : r
)

return expect(core.upload().then(validateNanoID)).resolves.toMatchSnapshot()
})

it('should not upload if onBeforeUpload returned false', () => {