mirror of https://github.com/grafana/grafana
Merge branch '11780_wrong_repexp_in_series' of https://github.com/SamuelToh/grafana into SamuelToh-11780_wrong_repexp_in_series
commit
01eb5fade3
@ -0,0 +1,15 @@ |
||||
import kbn from '../utils/kbn'; |
||||
|
||||
describe('stringToJsRegex', () => { |
||||
it('should parse the valid regex value', () => { |
||||
const output = kbn.stringToJsRegex("/validRegexp/"); |
||||
expect(output).toBeInstanceOf(RegExp); |
||||
}); |
||||
|
||||
it('should throw error on invalid regex value', () => { |
||||
const input = "/etc/hostname"; |
||||
expect(() => { |
||||
kbn.stringToJsRegex(input); |
||||
}).toThrow(); |
||||
}); |
||||
}); |
||||
Loading…
Reference in new issue