Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacroldan committed Nov 27, 2024
1 parent a28dfc6 commit 6f07989
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/app/src/cli/services/dev/update-extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {ExtensionUpdateDraftMutationVariables} from '../../api/graphql/partners/
import {inTemporaryDirectory, mkdir, writeFile} from '@shopify/cli-kit/node/fs'
import {outputInfo} from '@shopify/cli-kit/node/output'
import {describe, expect, vi, test} from 'vitest'
import {joinPath} from '@shopify/cli-kit/node/path'
import {dirname, joinPath} from '@shopify/cli-kit/node/path'
import {platformAndArch} from '@shopify/cli-kit/node/os'
import {randomUUID} from '@shopify/cli-kit/node/crypto'

Expand Down Expand Up @@ -206,7 +206,9 @@ describe('updateExtensionDraft()', () => {
const content = 'test content'
const base64Content = Buffer.from(content).toString('base64')
await mkdir(joinPath(mockExtension.directory, 'dist'))
await writeFile(joinPath(mockExtension.directory, 'dist', filepath), content)
const outputPath = mockExtension.getOutputPathForDirectory(tmpDir)
await mkdir(dirname(outputPath))
await writeFile(outputPath, content)

await updateExtensionDraft({
extension: mockExtension,
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/cli/services/dev/update-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ export async function updateExtensionDraft({
}: UpdateExtensionDraftOptions) {
let encodedFile: string | undefined
const outputPath = extension.getOutputPathForDirectory(bundlePath)

if (extension.features.includes('esbuild')) {
const outputPath = extension.getOutputPathForDirectory(bundlePath)
const content = await readFile(outputPath)
if (!content) return
encodedFile = Buffer.from(content).toString('base64')
Expand Down

0 comments on commit 6f07989

Please sign in to comment.