mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
25 lines
554 B
JavaScript
25 lines
554 B
JavaScript
'use strict';
|
|
|
|
const test = require('supertape');
|
|
|
|
const prefixer = require('./prefixer');
|
|
|
|
test('prefixer: prefix without a slash', (t) => {
|
|
t.equal(prefixer('hello'), '/hello', 'should add slash');
|
|
t.end();
|
|
});
|
|
|
|
test('prefixer: root', (t) => {
|
|
t.equal(prefixer('/'), '', 'should add slash');
|
|
t.end();
|
|
});
|
|
|
|
test('prefixer: with slash', (t) => {
|
|
t.equal(prefixer('/hello'), '/hello', 'should add slash');
|
|
t.end();
|
|
});
|
|
|
|
test('prefixer: not a string', (t) => {
|
|
t.equal(prefixer(false), '', 'should add slash');
|
|
t.end();
|
|
});
|