@@ -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 ,
@@ -10212,32 +10212,34 @@ describe('SnapController', () => {
1021210212 snapController . destroy ( ) ;
1021310213 } ) ;
1021410214
10215- it . only ( 'updates preinstalled Snaps' , async ( ) => {
10215+ it ( 'updates preinstalled Snaps' , async ( ) => {
1021610216 const registry = new MockSnapsRegistry ( ) ;
1021710217 const rootMessenger = getControllerMessenger ( registry ) ;
1021810218 const messenger = getSnapControllerMessenger ( rootMessenger ) ;
1021910219
1022010220 const snapId = 'npm:@metamask/jsx-example-snap' as SnapId ;
1022110221
10222- const mockSnap = getPersistedSnapObject ( { id : snapId , preinstalled : true } ) ;
10222+ const mockSnap = getPersistedSnapObject ( {
10223+ id : snapId ,
10224+ preinstalled : true ,
10225+ } ) ;
1022310226
1022410227 const updateVersion = '1.2.1' ;
10225-
10228+
1022610229 registry . resolveVersion . mockResolvedValue ( updateVersion ) ;
10227- const fetchFunction = jest . fn ( )
10228- . mockResolvedValueOnce ( {
10229- // eslint-disable-next-line no-restricted-globals
10230- headers : new Headers ( { 'content-length' : '5477' } ) ,
10231- ok : true ,
10232- body : Readable . toWeb (
10233- createReadStream (
10234- path . resolve (
10235- __dirname ,
10236- `../../test/fixtures/metamask-jsx-example-snap-${ updateVersion } .tgz` ,
10237- ) ,
10238- ) ,
10239- ) ,
10240- } as any ) ;
10230+ const fetchFunction = jest . fn ( ) . mockResolvedValueOnce ( {
10231+ // eslint-disable-next-line no-restricted-globals
10232+ headers : new Headers ( { 'content-length' : '5477' } ) ,
10233+ ok : true ,
10234+ body : Readable . toWeb (
10235+ createReadStream (
10236+ path . resolve (
10237+ __dirname ,
10238+ `../../test/fixtures/metamask-jsx-example-snap-${ updateVersion } .tgz` ,
10239+ ) ,
10240+ ) ,
10241+ ) ,
10242+ } as any ) ;
1024110243
1024210244 const snapController = getSnapController (
1024310245 getSnapControllerOptions ( {
0 commit comments