Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
szdziedzic committed Oct 17, 2024
1 parent ad86d28 commit a97f7c9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
3 changes: 3 additions & 0 deletions packages/eas-cli/src/commands/project/__tests__/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { AppMutation } from '../../../graphql/mutations/AppMutation';
import { AppQuery } from '../../../graphql/queries/AppQuery';
import { createOrModifyExpoConfigAsync } from '../../../project/expoConfig';
import { findProjectIdByAccountNameAndSlugNullableAsync } from '../../../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync';
import { isExpoInstalled } from '../../../project/projectUtils';
import { confirmAsync, promptAsync } from '../../../prompts';
import ProjectInit from '../init';

Expand All @@ -34,6 +35,7 @@ jest.mock('../../../ora', () => ({
}));
jest.mock('../../../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync');
jest.mock('../../../commandUtils/context/contextUtils/getProjectIdAsync');
jest.mock('../../../project/projectUtils');

let originalProcessArgv: string[];

Expand Down Expand Up @@ -91,6 +93,7 @@ function mockTestProject(options: {
featureGating: new FeatureGating({}, new FeatureGateEnvOverrides()),
graphqlClient,
});
jest.mocked(isExpoInstalled).mockReturnValue(true);
}

const commandOptions = { root: '/test-project' } as any;
Expand Down
11 changes: 1 addition & 10 deletions packages/eas-cli/src/commands/update/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,7 @@ describe(UpdatePublish.name, () => {

// Add configuration to the project that should not be included in the update
const { appJson } = mockTestProject({
expoConfig: {
hooks: {
postPublish: [
{
file: 'custom-hook.js',
config: { some: 'config' },
},
],
},
},
expoConfig: {},
});

const { platforms, runtimeVersion } = mockTestExport({ platforms: ['ios'] });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,7 @@ describe(UpdateRollBackToEmbedded.name, () => {

// Add configuration to the project that should not be included in the update
mockTestProject({
expoConfig: {
hooks: {
postPublish: [
{
file: 'custom-hook.js',
config: { some: 'config' },
},
],
},
},
expoConfig: {},
});

const platforms = ['ios'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export function createCtxMock(mockOverride: Record<string, any> = {}): Credentia
},
hasAppleCtx: jest.fn(() => true),
hasProjectContext: true,
exp: testAppJson,
getExpoConfigAsync: async () => testAppJson,
projectDir: '.',
getProjectIdAsync: async () => 'test-project-id',
};
return merge(defaultMock, mockOverride) as any;
}

0 comments on commit a97f7c9

Please sign in to comment.