mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
21 lines
422 B
TypeScript
21 lines
422 B
TypeScript
import RE2 from 're2';
|
|
import { RegEx } from '../../lib/util/regex';
|
|
|
|
describe('util/regex', () => {
|
|
beforeEach(() => {
|
|
jest.resetModules();
|
|
});
|
|
|
|
it('uses RE2', () => {
|
|
expect(RegEx).toEqual(RE2);
|
|
});
|
|
|
|
it('Falls back to RegExp', () => {
|
|
jest.doMock('re2', () => {
|
|
throw new Error();
|
|
});
|
|
|
|
const regex = require('../../lib/util/regex');
|
|
expect(regex.RegEx).toEqual(RegExp);
|
|
});
|
|
});
|