-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
27 lines (22 loc) · 833 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.split("\n")[0], 'deja-vu');
});
test('separator', async t => {
const {stdout} = await execa('./cli.js', ['Like a Boss', '--separator=_']);
t.is(stdout.split("\n")[0], 'like_a_boss');
});
test('lowercase', async t => {
const {stdout} = await execa('./cli.js', ['Déjà Vu!', '--no-lowercase']);
t.is(stdout.split("\n")[0], 'Deja-Vu');
});
test('decamelize', async t => {
const {stdout} = await execa('./cli.js', ['fooBar', '--no-decamelize']);
t.is(stdout.split("\n")[0], 'foobar');
});
test('preserve-leading-underscore', async t => {
const {stdout} = await execa('./cli.js', ['_foo_bar', '--preserve-leading-underscore']);
t.is(stdout.split("\n")[0], '_foo-bar');
});