File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
import path from 'path' ;
2
2
import nodeGypBuild from 'node-gyp-build' ;
3
3
4
+ interface Native {
5
+ addOne ( n : number ) : number ;
6
+ timesTwo ( n : number ) : number ;
7
+ createArr ( ) : [ number ] ;
8
+ createObj ( ) : { key : string } ;
9
+ setProperty ( obj : { key1 : string } ) : { key1 : string ; key2 : string } ;
10
+ }
11
+
4
12
// Path to project root containing package.json and binding.gyp
5
- const native = nodeGypBuild ( path . join ( __dirname , '../../' ) ) ;
13
+ const native : Native = nodeGypBuild ( path . join ( __dirname , '../../' ) ) ;
6
14
7
15
export default native ;
Original file line number Diff line number Diff line change @@ -24,8 +24,9 @@ describe('native bindings', () => {
24
24
// expect(native.createObj()).toStrictEqual({ key: 'hello world' });
25
25
} ) ;
26
26
test ( 'set property' , ( ) => {
27
- expect (
28
- native . setProperty ( { key1 : 'value1' } )
29
- ) . toStrictEqual ( { key1 : 'value1' , key2 : 'initial value1' } ) ;
27
+ expect ( native . setProperty ( { key1 : 'value1' } ) ) . toStrictEqual ( {
28
+ key1 : 'value1' ,
29
+ key2 : 'initial value1' ,
30
+ } ) ;
30
31
} ) ;
31
32
} ) ;
You can’t perform that action at this time.
0 commit comments