mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
23 lines
532 B
JavaScript
23 lines
532 B
JavaScript
import test from 'supertape';
|
|
|
|
import prefixer from './prefixer.js';
|
|
|
|
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();
|
|
});
|