@@ -70,11 +70,12 @@ import {
7070import { hmac } from '@noble/hashes/hmac' ;
7171import { sha512 } from '@noble/hashes/sha512' ;
7272import { File } from 'buffer' ;
73+ import { createReadStream } from 'fs' ;
7374import fetchMock from 'jest-fetch-mock' ;
75+ import path from 'path' ;
7476import { pipeline } from 'readable-stream' ;
7577import type { Duplex } from 'readable-stream' ;
7678import { inc } from 'semver' ;
77- import path from 'path' ;
7879import { Readable } from 'stream' ;
7980
8081import {
@@ -123,7 +124,6 @@ import {
123124 waitForStateChange ,
124125} from '../test-utils' ;
125126import { delay } from '../utils' ;
126- import { createReadStream } from 'fs' ;
127127
128128globalThis . crypto . getRandomValues = < Type extends ArrayBufferView | null > (
129129 array : Type ,
@@ -10156,32 +10156,34 @@ describe('SnapController', () => {
1015610156 snapController . destroy ( ) ;
1015710157 } ) ;
1015810158
10159- it . only ( 'updates preinstalled Snaps' , async ( ) => {
10159+ it ( 'updates preinstalled Snaps' , async ( ) => {
1016010160 const registry = new MockSnapsRegistry ( ) ;
1016110161 const rootMessenger = getControllerMessenger ( registry ) ;
1016210162 const messenger = getSnapControllerMessenger ( rootMessenger ) ;
1016310163
1016410164 const snapId = 'npm:@metamask/jsx-example-snap' as SnapId ;
1016510165
10166- const mockSnap = getPersistedSnapObject ( { id : snapId , preinstalled : true } ) ;
10166+ const mockSnap = getPersistedSnapObject ( {
10167+ id : snapId ,
10168+ preinstalled : true ,
10169+ } ) ;
1016710170
1016810171 const updateVersion = '1.2.1' ;
10169-
10172+
1017010173 registry . resolveVersion . mockResolvedValue ( updateVersion ) ;
10171- const fetchFunction = jest . fn ( )
10172- . mockResolvedValueOnce ( {
10173- // eslint-disable-next-line no-restricted-globals
10174- headers : new Headers ( { 'content-length' : '5477' } ) ,
10175- ok : true ,
10176- body : Readable . toWeb (
10177- createReadStream (
10178- path . resolve (
10179- __dirname ,
10180- `../../test/fixtures/metamask-jsx-example-snap-${ updateVersion } .tgz` ,
10181- ) ,
10182- ) ,
10183- ) ,
10184- } as any ) ;
10174+ const fetchFunction = jest . fn ( ) . mockResolvedValueOnce ( {
10175+ // eslint-disable-next-line no-restricted-globals
10176+ headers : new Headers ( { 'content-length' : '5477' } ) ,
10177+ ok : true ,
10178+ body : Readable . toWeb (
10179+ createReadStream (
10180+ path . resolve (
10181+ __dirname ,
10182+ `../../test/fixtures/metamask-jsx-example-snap-${ updateVersion } .tgz` ,
10183+ ) ,
10184+ ) ,
10185+ ) ,
10186+ } as any ) ;
1018510187
1018610188 const snapController = getSnapController (
1018710189 getSnapControllerOptions ( {
0 commit comments