We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9403217 commit a2535c7Copy full SHA for a2535c7
src/main.test.ts
@@ -783,6 +783,26 @@ describe('setJSON', () => {
783
784
expect(mockStore.fulfilled).toBeTruthy()
785
})
786
+
787
+ test('Throws when the `metadata` parameter is above the size limit', async () => {
788
+ const metadata = {
789
+ name: 'Netlify'.repeat(1000),
790
+ }
791
+ const mockStore = new MockFetch()
792
793
+ globalThis.fetch = mockStore.fetch
794
795
+ const blobs = getStore({
796
+ edgeURL,
797
+ name: 'production',
798
+ token: edgeToken,
799
+ siteID,
800
+ })
801
802
+ expect(async () => await blobs.setJSON(key, { value }, { metadata })).rejects.toThrowError(
803
+ 'Metadata object exceeds the maximum size',
804
+ )
805
806
807
808
0 commit comments