Skip to content

Commit 82c7676

Browse files
committed
Tidied tests and removed debug prints
1 parent aa80e2f commit 82c7676

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

modules/utils/Path.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ var Path = {
8484

8585
var splatIndex = 0;
8686

87-
var url = pattern.replace(paramInjectMatcher, function (match, paramName) {
87+
return pattern.replace(paramInjectMatcher, function (match, paramName) {
8888
paramName = paramName || 'splat';
8989

9090
// If param is optional don't check for existence
@@ -113,12 +113,7 @@ var Path = {
113113
}
114114

115115
return encodeURLPath(segment);
116-
});
117-
url = url.replace(paramInjectTrailingSlashMatcher, '/');
118-
119-
console.log(url);
120-
121-
return url;
116+
}).replace(paramInjectTrailingSlashMatcher, '/');
122117
},
123118

124119
/**

modules/utils/__tests__/Path-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('Path.extractParams', function () {
6262
});
6363
});
6464
describe('and the pattern and forward slash are optional', function () {
65-
var pattern = 'comments/:id?/edit'
65+
var pattern = 'comments/:id?/?edit'
6666

6767
describe('and the path matches with supplied param', function () {
6868
it('returns an object with the params', function () {

0 commit comments

Comments
 (0)