test(matchers): add support for toMatchPattern in tests

This commit is contained in:
Matias Niemelä
2016-03-08 15:37:03 -08:00
committed by Alex Eagle
parent b691da26af
commit 169869a195
3 changed files with 36 additions and 0 deletions

View File

@ -54,6 +54,14 @@ export function main() {
});
});
describe("toMatchPAttern", () => {
it("should assert that a string matches a given pattern", () => {
expect("matias").toMatchPattern(/ias$/g);
expect("tobias").toMatchPattern(/ias$/g);
expect("joonas").not.toMatchPattern(/ias$/g);
});
});
describe('toEqual for Maps', () => {
it('should detect equality for same reference', () => {
var m1 = MapWrapper.createFromStringMap({'a': 1});