0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 05:28:35 +00:00
renovatebot_renovate/lib/util/ignore.spec.ts
2023-11-21 12:40:36 +00:00

34 lines
921 B
TypeScript

import { logger } from '../logger';
import { isSkipComment } from './ignore';
jest.mock('../logger', () => ({
logger: {
debug: jest.fn(),
},
}));
describe('util/ignore', () => {
it('returns true for "renovate:ignore" comments', () => {
expect(isSkipComment('renovate:ignore')).toBe(true);
});
it('returns false for comments not starting with "renovate:" or "pyup:"', () => {
expect(isSkipComment('other:ignore')).toBe(false);
});
it('returns false for "renovate:" comments without "ignore"', () => {
expect(isSkipComment('renovate:update')).toBe(false);
});
it('logs unknown command for "renovate:" comments without "ignore"', () => {
isSkipComment('renovate:update');
expect(logger.debug).toHaveBeenCalledWith(
'Unknown comment command: update',
);
});
it('returns false when comment is undefined', () => {
expect(isSkipComment()).toBe(false);
});
});