Merge branch 'hotfix/21.56.9' into master
[gitter.git] / modules / uri-resolver / test / normalise-uri-test.js
blobe3a53d831651bc507c73d421e27fe893a0d8e9be
1 'use strict';
3 var normaliseUri = require('../lib/normalise-uri');
4 var assert = require('assert');
6 describe('normalise-uri', function() {
7 var FIXTURES = [
9 given: 'gitterHQ/',
10 parts: ['gitterHQ'],
11 path: 'gitterHQ'
14 given: 'gitterHQ',
15 parts: ['gitterHQ'],
16 path: 'gitterHQ'
19 given: 'gitterHQ//',
20 parts: ['gitterHQ'],
21 path: 'gitterHQ'
24 given: 'gitterHQ/x/',
25 parts: ['gitterHQ', 'x'],
26 path: 'gitterHQ/x'
29 given: '/',
30 parts: [],
31 path: ''
34 given: '//////',
35 parts: [],
36 path: ''
40 FIXTURES.forEach(function(fixture) {
41 it('should handle ' + fixture.given, function() {
42 assert.deepEqual(normaliseUri.toParts(fixture.given), fixture.parts);
43 assert.strictEqual(normaliseUri.toPath(fixture.given), fixture.path);
44 });
45 });
46 });