[css] requests update

This commit is contained in:
Martin Aeschlimann
2020-06-08 13:40:26 +02:00
parent cbb1610c12
commit b49d4cf5e6
2 changed files with 27 additions and 2 deletions

View File

@@ -4,8 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import { joinPath, normalizePath, resolvePath } from '../requests';
import { joinPath, normalizePath, resolvePath, extname } from '../requests';
suite('requests', () => {
test('join', async function () {
@@ -51,4 +50,13 @@ suite('requests', () => {
assertNormalize('..', '');
assertNormalize('/..', '/');
});
test('extname', async function () {
function assertExtName(input: string, expected: string) {
assert.equal(extname(input), expected, input);
}
assertExtName('foo://a/foo/bar', '');
assertExtName('foo://a/foo/bar.foo', '.foo');
assertExtName('foo://a/foo/.foo', '');
});
});