Skip to content

Commit

Permalink
Fix failing build
Browse files Browse the repository at this point in the history
  • Loading branch information
kemmerle committed Jan 17, 2025
1 parent 1603267 commit 85efe4e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
14 changes: 13 additions & 1 deletion lib/__tests__/ProjectLogsManager.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
import { ProjectLogsManager } from '../projects/ProjectLogsManager';
import { getProjectConfig, ensureProjectExists } from '../projects';
import { fetchProjectComponentsMetadata } from '@hubspot/local-dev-lib/api/projects';
import { SUBCOMPONENT_TYPES } from '../../../hubspot-local-dev-lib/dist/enums/build';

const SUBCOMPONENT_TYPES = {
APP_ID: 'APP_ID',
PACKAGE_LOCK_FILE: 'PACKAGE_LOCK_FILE',
CRM_CARD_V2: 'CRM_CARD_V2',
CARD_V2: 'CARD_V2',
SERVERLESS_PKG: 'SERVERLESS_PKG',
SERVERLESS_ROUTE: 'SERVERLESS_ROUTE',
SERVERLESS_FUNCTION: 'SERVERLESS_FUNCTION',
APP_FUNCTION: 'APP_FUNCTION',
AUTOMATION_ACTION: 'AUTOMATION_ACTION',
REACT_EXTENSION: 'REACT_EXTENSION',
} as const;

jest.mock('../projects');
jest.mock('@hubspot/local-dev-lib/api/projects');
Expand Down
2 changes: 1 addition & 1 deletion lib/__tests__/dependencyManagement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import SpinniesManager from '../ui/SpinniesManager';
import { existsSync } from 'fs';

describe('lib/dependencyManagement', () => {
let execMock;
let execMock: jest.Mock;

const projectDir = path.join('path', 'to', 'project');
const srcDir = 'src';
Expand Down
13 changes: 9 additions & 4 deletions lib/__tests__/projects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jest.mock('@hubspot/local-dev-lib/logger');

describe('lib/projects', () => {
describe('validateProjectConfig()', () => {
let realProcess;
let projectDir;
let exitMock;
let realProcess: NodeJS.Process;
let projectDir: string;
let exitMock: jest.Mock;

beforeAll(() => {
projectDir = fs.mkdtempSync(path.join(os.tmpdir(), 'projects-'));
Expand All @@ -22,7 +22,12 @@ describe('lib/projects', () => {

beforeEach(() => {
exitMock = jest.fn();
global.process = { ...realProcess, exit: exitMock };
global.process = {
...realProcess,
exit: exitMock as unknown as (
code?: number | string | null | undefined
) => never,
};
});

afterAll(() => {
Expand Down

0 comments on commit 85efe4e

Please sign in to comment.