Skip to content
Snippets Groups Projects
Unverified Commit d4db4995 authored by Imamuzzaki Abu Salam's avatar Imamuzzaki Abu Salam Committed by GitHub
Browse files

test: add ignore utility test (#25891)

parent 3c656815
No related branches found
No related tags found
No related merge requests found
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);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment