Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ module.exports = {
transform: {
'\\.[jt]sx?$': ['ts-jest', tsJestOptions],
},
transformIgnorePatterns: [
'node_modules[\\\\/](?!(@inquirer|fast-.+)[\\\\/])',
],
transformIgnorePatterns: ['node_modules[\\\\/](?!(fast-.+)[\\\\/])'],
moduleNameMapper: {
'^(\\.\\.?\\/.+)\\.js$': '$1',
},
Expand Down
41 changes: 40 additions & 1 deletion jest.setup.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,43 @@ jest.mock('fs-extra', () => ({
}));

jest.mock('child_process');
jest.mock('progress');

// @clack/prompts ships ESM only and draws to a real terminal, so it is mocked
// globally. Suites that assert on a specific prompt override this with their
// own factory; the defaults here simply keep every other suite loadable.
jest.mock('@clack/prompts', () => {
const CANCEL_SYMBOL = Symbol.for('clack:cancel');

return {
__esModule: true,
CANCEL_SYMBOL,
isCancel: (value) => value === CANCEL_SYMBOL,
intro: jest.fn(),
outro: jest.fn(),
cancel: jest.fn(),
note: jest.fn(),
box: jest.fn(),
text: jest.fn(),
select: jest.fn(),
confirm: jest.fn(),
multiselect: jest.fn(),
spinner: jest.fn(() => ({
start: jest.fn(),
stop: jest.fn(),
message: jest.fn(),
cancel: jest.fn(),
error: jest.fn(),
clear: jest.fn(),
isCancelled: false,
})),
log: {
message: jest.fn(),
info: jest.fn(),
success: jest.fn(),
step: jest.fn(),
warn: jest.fn(),
warning: jest.fn(),
error: jest.fn(),
},
};
});
Loading
Loading