-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e05f0f
commit 507b959
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; // eslint-disable-line | ||
|
||
const assert = require('assert'); | ||
const constants = require('../../../../lib/constants'); | ||
const { parseURL } = require('../../../../lib/network/rest/utils'); | ||
|
||
describe('parseURL function', () => { | ||
[ | ||
{ | ||
inputUrl: `${constants.passthroughFileURL}/test`, | ||
expectedKey: 'test', | ||
}, | ||
{ | ||
inputUrl: `${constants.passthroughFileURL}/test with spaces`, | ||
expectedKey: 'test with spaces', | ||
}, | ||
].forEach(testCase => { | ||
const { inputUrl, expectedKey } = testCase; | ||
|
||
it(`should return ${expectedKey} with url "${inputUrl}"`, | ||
() => { | ||
const pathInfo = parseURL(inputUrl, true); | ||
assert.strictEqual(pathInfo.key, expectedKey); | ||
}); | ||
}); | ||
}); |