-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
42 lines (38 loc) · 1.46 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import test from 'ava';
import arvishTest from 'arvish-test';
test('result', async t => {
const arvish = arvishTest({
vars: {
query: 'ec2 accept reserved'
}
});
const result = await arvish('node index.js {query}');
t.deepEqual(result[0], {
title: 'acceptReservedInstancesExchangeQuote',
autocomplete: 'acceptReservedInstancesExchangeQuote',
subtitle: 'Elastic Compute Cloud',
arg: 'http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#acceptReservedInstancesExchangeQuote-property',
quicklookurl: 'http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#acceptReservedInstancesExchangeQuote-property',
icon: {
path: './icons/EC2.png'
},
keywords: 'EC2 acceptReservedInstancesExchangeQuote Elastic Compute Cloud',
count: 3
});
});
test('fallback icon', async t => {
const arvish = arvishTest();
const result = await arvish('node index.js startsupport');
t.deepEqual(result[0], {
title: 'startSupportDataExport',
autocomplete: 'startSupportDataExport',
subtitle: 'Marketplace Commerce Analytics',
arg: 'http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/MarketplaceCommerceAnalytics.html#startSupportDataExport-property',
quicklookurl: 'http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/MarketplaceCommerceAnalytics.html#startSupportDataExport-property',
icon: {
path: './icons/aws.png'
},
keywords: 'MarketplaceCommerceAnalytics startSupportDataExport Marketplace Commerce Analytics',
count: 1
});
});