Refactoring of PR #14772

This commit is contained in:
Torkel Ödegaard
2019-03-08 13:49:48 +01:00
parent 01eb5fade3
commit 878da68c90
2 changed files with 3 additions and 7 deletions

View File

@@ -2,12 +2,12 @@ import kbn from '../utils/kbn';
describe('stringToJsRegex', () => {
it('should parse the valid regex value', () => {
const output = kbn.stringToJsRegex("/validRegexp/");
const output = kbn.stringToJsRegex('/validRegexp/');
expect(output).toBeInstanceOf(RegExp);
});
it('should throw error on invalid regex value', () => {
const input = "/etc/hostname";
const input = '/etc/hostname';
expect(() => {
kbn.stringToJsRegex(input);
}).toThrow();