@@ -23,8 +23,7 @@ import {testApp, testFunctionExtension} from '../../models/app/app.test-data.js'
2323import { beforeEach , describe , expect , test , vi } from 'vitest'
2424import { exec } from '@shopify/cli-kit/node/system'
2525import { dirname , joinPath } from '@shopify/cli-kit/node/path'
26- import { inTemporaryDirectory , mkdir , readFileSync , writeFile , removeFile } from '@shopify/cli-kit/node/fs'
27- import * as fsNode from '@shopify/cli-kit/node/fs'
26+ import { inTemporaryDirectory , mkdir , readFile , readFileSync , writeFile , removeFile } from '@shopify/cli-kit/node/fs'
2827import { build as esBuild } from 'esbuild'
2928import { generate } from '@graphql-codegen/cli'
3029
@@ -90,7 +89,7 @@ describe('buildGraphqlTypes', () => {
9089 } ,
9190 } ,
9291 }
93- vi . spyOn ( fsNode , ' readFile' ) . mockImplementation ( async ( path : string ) => {
92+ vi . mocked ( readFile ) . mockImplementation ( async ( path : string ) => {
9493 if ( path === joinPath ( ourFunction . directory , 'package.json' ) ) {
9594 return JSON . stringify ( packageJson ) as any
9695 }
@@ -102,7 +101,7 @@ describe('buildGraphqlTypes', () => {
102101
103102 // Then
104103 await expect ( got ) . resolves . toBeUndefined ( )
105- expect ( fsNode . readFile ) . toHaveBeenCalledWith ( joinPath ( ourFunction . directory , 'package.json' ) )
104+ expect ( readFile ) . toHaveBeenCalledWith ( joinPath ( ourFunction . directory , 'package.json' ) )
106105 expect ( vi . mocked ( generate ) ) . toHaveBeenCalledWith ( {
107106 cwd : ourFunction . directory ,
108107 ...packageJson . codegen ,
0 commit comments