Skip to content

Commit 5c878ae

Browse files
committed
fix(test): resolve migrate-client mock by absolute path for CI compatibility
1 parent b00160f commit 5c878ae

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

pgpm/cli/__tests__/export-parity.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ jest.doMock(_graphqlClientPath, () => ({
3232
}))
3333
}));
3434

35-
// Mock @pgpmjs/migrate-client so the ORM-based sql_actions fetch uses our test data
36-
const _migrateClientPath = '@pgpmjs/migrate-client';
35+
// Mock @pgpmjs/migrate-client so the ORM-based sql_actions fetch uses our test data.
36+
// Use an absolute path (same pattern as GraphQLClient above) so Jest can resolve
37+
// the module from pgpm/cli even though it is only a dependency of pgpm/core.
38+
const _migrateClientPath = path.resolve(
39+
__dirname,
40+
'../../../sdk/migrate-client/dist/index'
41+
);
3742
let _mockMigrateClientFindMany: jest.Mock = jest.fn();
3843
jest.doMock(_migrateClientPath, () => ({
3944
createClient: jest.fn().mockImplementation(() => ({

0 commit comments

Comments
 (0)