Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add ignore utility test (#25891)
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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); | ||
}); | ||
}); |