-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
16 lines (14 loc) · 878 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import test from 'ava';
import execa from 'execa';
test('main', async t => {
t.is(await execa.stdout('node', ['cli.js', 'unicorn!foobar']), 'unicorn%21foobar');
t.is(await execa.stdout('node', ['cli.js', 'unicorn\'foobar']), 'unicorn%27foobar');
t.is(await execa.stdout('node', ['cli.js', 'unicorn*foobar']), 'unicorn%2Afoobar');
t.not(await execa.stdout('node', ['cli.js', 'unicorn*foobar']), encodeURIComponent('unicorn*foobar'));
});
test('stdin', async t => {
t.is(await execa.stdout('node', ['cli.js'], {input: 'unicorn!foobar'}), 'unicorn%21foobar');
t.is(await execa.stdout('node', ['cli.js'], {input: 'unicorn\'foobar'}), 'unicorn%27foobar');
t.is(await execa.stdout('node', ['cli.js'], {input: 'unicorn*foobar'}), 'unicorn%2Afoobar');
t.not(await execa.stdout('node', ['cli.js'], {input: 'unicorn*foobar'}), encodeURIComponent('unicorn*foobar'));
});