Skip to content

Commit 32e6600

Browse files
authored
chore: fixing npm deploy script (#27)
1 parent 999f6ed commit 32e6600

2 files changed

Lines changed: 30 additions & 21 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
run: npm run build
4747

4848
- name: Publish to npm
49-
run: npm publish
49+
run: NPM_CONFIG_PROVENANCE=false npm publish # remove prominance disable when we open source this package

tests/setup.ts

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
// Load environment variables from .env file if it exists
2-
import { config } from 'dotenv';
3-
import { existsSync } from 'fs';
4-
import { join } from 'path';
2+
import { config } from "dotenv";
3+
import { existsSync } from "fs";
4+
import { join } from "path";
55

66
// Load .env file if it exists
7-
const envPath = join(process.cwd(), '.env');
7+
const envPath = join(process.cwd(), ".env");
88
if (existsSync(envPath)) {
99
config({ path: envPath });
1010
}
1111

12-
// Set default test environment variables
13-
process.env.RUNLOOP_ENV = process.env.RUNLOOP_ENV || 'dev';
14-
process.env.RUNLOOP_API_KEY = process.env.RUNLOOP_API_KEY || 'ak_test_key';
15-
process.env.RUNLOOP_BASE_URL = process.env.RUNLOOP_BASE_URL || 'https://api.runloop.pro';
16-
process.env.NODE_ENV = process.env.NODE_ENV || 'test';
17-
1812
// Mock console methods for cleaner test output (only for unit tests)
1913
if (!process.env.RUN_E2E) {
2014
const originalConsole = global.console;
@@ -36,19 +30,19 @@ if (!process.env.RUN_E2E) {
3630

3731
// Add pending function for integration tests
3832
global.pending = (reason?: string) => {
39-
throw new Error(`Test pending: ${reason || 'No reason provided'}`);
33+
throw new Error(`Test pending: ${reason || "No reason provided"}`);
4034
};
4135

4236
// Mock interactive command runner to prevent Ink issues in tests
43-
jest.mock('../src/utils/interactiveCommand.js', () => ({
37+
jest.mock("../src/utils/interactiveCommand.js", () => ({
4438
runInteractiveCommand: jest.fn(async (fn) => {
4539
// Just run the function directly without Ink
4640
return await fn();
4741
}),
4842
}));
4943

5044
// Mock Ink components to prevent raw mode issues
51-
jest.mock('ink', () => ({
45+
jest.mock("ink", () => ({
5246
render: jest.fn(),
5347
Box: ({ children }: any) => children,
5448
Text: ({ children }: any) => children,
@@ -63,12 +57,27 @@ jest.mock('ink', () => ({
6357
}));
6458

6559
// Mock ESM-only Ink dependencies so Jest doesn't parse their ESM bundles
66-
jest.mock('ink-big-text', () => ({ __esModule: true, default: () => null }));
67-
jest.mock('ink-gradient', () => ({ __esModule: true, default: () => null }));
60+
jest.mock("ink-big-text", () => ({ __esModule: true, default: () => null }));
61+
jest.mock("ink-gradient", () => ({ __esModule: true, default: () => null }));
6862

6963
// Mock app UI components that import Ink deps, to avoid pulling in ESM from node_modules
70-
jest.mock('../src/components/Banner.tsx', () => ({ __esModule: true, Banner: () => null }));
71-
jest.mock('../src/components/Header.tsx', () => ({ __esModule: true, Header: () => null }));
72-
jest.mock('../src/components/Spinner.tsx', () => ({ __esModule: true, SpinnerComponent: () => null }));
73-
jest.mock('../src/components/SuccessMessage.tsx', () => ({ __esModule: true, SuccessMessage: () => null }));
74-
jest.mock('../src/components/ErrorMessage.tsx', () => ({ __esModule: true, ErrorMessage: () => null }));
64+
jest.mock("../src/components/Banner.tsx", () => ({
65+
__esModule: true,
66+
Banner: () => null,
67+
}));
68+
jest.mock("../src/components/Header.tsx", () => ({
69+
__esModule: true,
70+
Header: () => null,
71+
}));
72+
jest.mock("../src/components/Spinner.tsx", () => ({
73+
__esModule: true,
74+
SpinnerComponent: () => null,
75+
}));
76+
jest.mock("../src/components/SuccessMessage.tsx", () => ({
77+
__esModule: true,
78+
SuccessMessage: () => null,
79+
}));
80+
jest.mock("../src/components/ErrorMessage.tsx", () => ({
81+
__esModule: true,
82+
ErrorMessage: () => null,
83+
}));

0 commit comments

Comments
 (0)