File tree 1 file changed +26
-1
lines changed
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import semver from 'semver'
5
5
import tmp from 'tmp-promise'
6
6
import { test , expect , beforeAll , afterEach } from 'vitest'
7
7
8
- import { getStore } from './main.js'
8
+ import { getDeployStore , getStore } from './main.js'
9
9
import { BlobsServer } from './server.js'
10
10
11
11
beforeAll ( async ( ) => {
@@ -286,3 +286,28 @@ test('Lists entries', async () => {
286
286
287
287
expect ( parachutesSongs2 . directories ) . toEqual ( [ ] )
288
288
} )
289
+
290
+ test ( 'Works with a deploy-scoped store' , async ( ) => {
291
+ const deployID = '655f77a1b48f470008e5879a'
292
+ const directory = await tmp . dir ( )
293
+ const server = new BlobsServer ( {
294
+ directory : directory . path ,
295
+ token,
296
+ } )
297
+ const { port } = await server . start ( )
298
+
299
+ const store = getDeployStore ( {
300
+ deployID,
301
+ edgeURL : `http://localhost:${ port } ` ,
302
+ token,
303
+ siteID,
304
+ } )
305
+ const key = 'my-key'
306
+
307
+ await store . set ( key , 'value 1 for store 1' )
308
+
309
+ expect ( await store . get ( key ) ) . toBe ( 'value 1 for store 1' )
310
+
311
+ await server . stop ( )
312
+ await fs . rm ( directory . path , { force : true , recursive : true } )
313
+ } )
You can’t perform that action at this time.
0 commit comments