diff --git a/dev/tests/spec/lexer.spec.js b/dev/tests/spec/lexer.spec.js index 33b12f7..eae0e2d 100644 --- a/dev/tests/spec/lexer.spec.js +++ b/dev/tests/spec/lexer.spec.js @@ -1,5 +1,5 @@ //for node -var crossroads = crossroads || require('../../../dist/crossroads'); +let crossroads = crossroads || require('../../../dist/crossroads'); //end node @@ -9,7 +9,7 @@ describe('patternLexer', function(){ describe('getParamIds()', function(){ it('should return an Array with the ids', function(){ - var ids = crossroads.patternLexer.getParamIds('/lorem/{ipsum}/{dolor}'); + let ids = crossroads.patternLexer.getParamIds('/lorem/{ipsum}/{dolor}'); expect( ids[0] ).toEqual( 'ipsum' ); expect( ids[1] ).toEqual( 'dolor' ); }); @@ -21,25 +21,25 @@ describe('patternLexer', function(){ describe('compilePattern()', function(){ it('should create RegExp from string which should match pattern', function(){ - var pattern = '/lorem/{ipsum}/{dolor}', + let pattern = '/lorem/{ipsum}/{dolor}', regex = crossroads.patternLexer.compilePattern(pattern); expect( regex.test(pattern) ).toEqual( true ); }); it('should work with special chars', function(){ - var pattern = '/lo[rem](ipsum)/{ipsum}/{dolor}', + let pattern = '/lo[rem](ipsum)/{ipsum}/{dolor}', regex = crossroads.patternLexer.compilePattern(pattern); expect( regex.test(pattern) ).toEqual( true ); }); it('should work with optional params', function(){ - var pattern = '/lo[rem](ipsum)/{ipsum}/{dolor}:foo::bar:/:blah:/maecennas', + let pattern = '/lo[rem](ipsum)/{ipsum}/{dolor}:foo::bar:/:blah:/maecennas', regex = crossroads.patternLexer.compilePattern(pattern); expect( regex.test(pattern) ).toEqual( true ); }); it('should support rest params', function(){ - var pattern = '/lo[rem](ipsum)/{ipsum*}/{dolor}:foo::bar*:/:blah:/maecennas', + let pattern = '/lo[rem](ipsum)/{ipsum*}/{dolor}:foo::bar*:/:blah:/maecennas', regex = crossroads.patternLexer.compilePattern(pattern); expect( regex.test(pattern) ).toEqual( true ); }); @@ -50,7 +50,7 @@ describe('patternLexer', function(){ describe('getParamValues()', function(){ it('should return pattern params', function(){ - var pattern = '/lorem/{ipsum}/{dolor}', + let pattern = '/lorem/{ipsum}/{dolor}', regex = crossroads.patternLexer.compilePattern(pattern), params = crossroads.patternLexer.getParamValues('/lorem/foo/bar', regex);