-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.js
27 lines (22 loc) · 774 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import test from 'ava';
import execa from 'execa';
test('main', async t => {
const {stdout} = await execa('./cli.js', ['Déjà Vu!']);
t.is(stdout, 'deja-vu');
});
test('separator', async t => {
const {stdout} = await execa('./cli.js', ['Unicorns & Rainbows', '--separator=_']);
t.is(stdout, 'unicorns_and_rainbows');
});
test('lowercase', async t => {
const {stdout} = await execa('./cli.js', ['Déjà Vu!', '--no-lowercase']);
t.is(stdout, 'Deja-Vu');
});
test('decamelize', async t => {
const {stdout} = await execa('./cli.js', ['fooBar', '--no-decamelize']);
t.is(stdout, 'foobar');
});
test('preserve-leading-underscore', async t => {
const {stdout} = await execa('./cli.js', ['_foo_bar', '--preserve-leading-underscore']);
t.is(stdout, '_foo-bar');
});