File tree Expand file tree Collapse file tree 8 files changed +566
-7
lines changed Expand file tree Collapse file tree 8 files changed +566
-7
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const cleanStack = require('clean-stack');
8
8
const dotProp = require ( 'dot-prop' ) ;
9
9
const CacheConf = require ( 'cache-conf' ) ;
10
10
const AlfredConfig = require ( 'alfred-config' ) ;
11
- const updateNotification = require ( './lib/update-notification' ) ;
11
+ const updateNotification = require ( './lib/update-notification.js ' ) ;
12
12
13
13
const alfy = module . exports ;
14
14
Original file line number Diff line number Diff line change
1
+ /* eslint-disable @typescript-eslint/no-confusing-void-expression */
2
+
3
+ import { expectType } from 'tsd' ;
4
+ import alfy , { ScriptFilterItem } from './index.js' ;
5
+
6
+ const mockItems : ScriptFilterItem [ ] = [
7
+ {
8
+ title : 'Unicorn'
9
+ } ,
10
+ {
11
+ title : 'Rainbow'
12
+ }
13
+ ] ;
14
+
15
+ expectType < void > ( alfy . output ( mockItems ) ) ;
16
+
17
+ expectType < string [ ] > ( alfy . matches ( 'Corn' , [ 'foo' , 'unicorn' ] ) ) ;
18
+
19
+ expectType < ScriptFilterItem [ ] > ( alfy . matches ( 'Unicorn' , mockItems , 'title' ) ) ;
20
+
21
+ expectType < string [ ] > ( alfy . inputMatches ( [ 'foo' , 'unicorn' ] ) ) ;
22
+
23
+ expectType < ScriptFilterItem [ ] > ( alfy . inputMatches ( mockItems , 'title' ) ) ;
24
+
25
+ expectType < void > ( alfy . error ( new Error ( 'some error' ) ) ) ;
26
+
27
+ expectType < void > ( alfy . log ( 'some message' ) ) ;
28
+
29
+ expectType < Promise < any > > ( alfy . fetch ( 'https://foo.bar' , {
30
+ transform : body => {
31
+ body . foo = 'bar' ;
32
+ return body ;
33
+ }
34
+ } ) ) ;
Original file line number Diff line number Diff line change 13
13
"node" : " >=10"
14
14
},
15
15
"scripts" : {
16
- "test" : " xo && ava"
16
+ "test" : " xo && ava && tsd "
17
17
},
18
18
"files" : [
19
19
" index.js" ,
20
+ " index.d.ts" ,
20
21
" init.js" ,
21
22
" cleanup.js" ,
22
23
" run-node.sh" ,
53
54
"delay" : " ^4.3.0" ,
54
55
"nock" : " ^13.1.0" ,
55
56
"tempfile" : " ^3.0.0" ,
56
- "xo" : " ^0.24.0"
57
+ "tsd" : " ^0.17.0" ,
58
+ "typescript" : " ^4.3.5" ,
59
+ "xo" : " ^0.39.1"
57
60
}
58
61
}
Original file line number Diff line number Diff line change 1
1
import test from 'ava' ;
2
2
import delay from 'delay' ;
3
3
import tempfile from 'tempfile' ;
4
- import { alfy as createAlfy } from './_utils' ;
4
+ import { alfy as createAlfy } from './_utils.js ' ;
5
5
6
6
test ( 'no cache' , t => {
7
7
const alfy = createAlfy ( ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import test from 'ava';
2
2
import nock from 'nock' ;
3
3
import delay from 'delay' ;
4
4
import tempfile from 'tempfile' ;
5
- import { alfy as createAlfy } from './_utils' ;
5
+ import { alfy as createAlfy } from './_utils.js ' ;
6
6
7
7
const URL = 'https://foo.bar' ;
8
8
Original file line number Diff line number Diff line change 1
1
import test from 'ava' ;
2
2
import hookStd from 'hook-std' ;
3
- import { alfy } from './_utils' ;
3
+ import { alfy } from './_utils.js ' ;
4
4
5
5
const alfyInstance = alfy ( ) ;
6
6
Original file line number Diff line number Diff line change 1
1
import path from 'path' ;
2
2
import test from 'ava' ;
3
- import { alfy as createAlfy } from './_utils' ;
3
+ import { alfy as createAlfy } from './_utils.js ' ;
4
4
5
5
test ( 'read user config' , t => {
6
6
const alfy = createAlfy ( {
You can’t perform that action at this time.
0 commit comments