From 432814fb50961b2f848ab20bfedc62142b88baf4 Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Wed, 19 Feb 2020 15:53:13 +0200 Subject: [PATCH 1/2] library regexp test fixed --- tests/routesRegexp.spec.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/routesRegexp.spec.js b/tests/routesRegexp.spec.js index e81165204..5b82d1832 100644 --- a/tests/routesRegexp.spec.js +++ b/tests/routesRegexp.spec.js @@ -118,11 +118,21 @@ describe('routesRegexp', () => { .toEqual(['/library', undefined, undefined]); }); + it('match /library/', async () => { + expect(Array.from('/library/'.match(routesRegexp.library.regexp))) + .toEqual(['/library/', '', undefined]); + }) + it('match /library//', async () => { expect(Array.from('/library//'.match(routesRegexp.library.regexp))) .toEqual(['/library//', '', '']); }); + it('match /library/1', async () => { + expect(Array.from('/library/1'.match(routesRegexp.library.regexp))) + .toEqual(['/library/1', '1', undefined]); + }) + it('match /library/1/', async () => { expect(Array.from('/library/1/'.match(routesRegexp.library.regexp))) .toEqual(['/library/1/', '1', '']); @@ -138,21 +148,11 @@ describe('routesRegexp', () => { .toEqual(['/library/1/2', '1', '2']); }); - it('not match /library/', async () => { - expect('/library/'.match(routesRegexp.library.regexp)) - .toBe(null); - }); - it('not match /library///', async () => { expect('/library///'.match(routesRegexp.library.regexp)) .toBe(null); }); - it('not match /library/1', async () => { - expect('/library/1'.match(routesRegexp.library.regexp)) - .toBe(null); - }); - it('not match /library/1/2/', async () => { expect('/library/1/2/'.match(routesRegexp.library.regexp)) .toBe(null); From b664e6bd1eb030d740c733b4beab28c72a6d1f00 Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Wed, 19 Feb 2020 16:03:35 +0200 Subject: [PATCH 2/2] semicolon added --- tests/routesRegexp.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/routesRegexp.spec.js b/tests/routesRegexp.spec.js index 5b82d1832..c90bad859 100644 --- a/tests/routesRegexp.spec.js +++ b/tests/routesRegexp.spec.js @@ -121,7 +121,7 @@ describe('routesRegexp', () => { it('match /library/', async () => { expect(Array.from('/library/'.match(routesRegexp.library.regexp))) .toEqual(['/library/', '', undefined]); - }) + }); it('match /library//', async () => { expect(Array.from('/library//'.match(routesRegexp.library.regexp))) @@ -131,7 +131,7 @@ describe('routesRegexp', () => { it('match /library/1', async () => { expect(Array.from('/library/1'.match(routesRegexp.library.regexp))) .toEqual(['/library/1', '1', undefined]); - }) + }); it('match /library/1/', async () => { expect(Array.from('/library/1/'.match(routesRegexp.library.regexp)))