Skip to content

Commit

Permalink
Fix path in unbundled unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frandiox committed Jan 16, 2025
1 parent f8bb4d6 commit c1062a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/theme/src/cli/utilities/asset-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import {createRequire} from 'node:module'
const require = createRequire(import.meta.url)

export async function resolveAssetPath(...subpaths: string[]) {
if (process.env.SHOPIFY_UNIT_TEST) {
return joinPath(__dirname, '..', '..', '..', ...subpaths)
}

const cliRootPath = dirname(require.resolve('@shopify/cli/package.json'))
return joinPath(cliRootPath, 'dist', 'assets', ...subpaths)
}

0 comments on commit c1062a9

Please sign in to comment.