File tree 4 files changed +24
-2
lines changed
4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' ) ;
2
+ const { version } = require ( './package.json' ) ;
2
3
3
4
const includeDir = path . relative ( '.' , __dirname ) ;
4
5
@@ -7,6 +8,7 @@ module.exports = {
7
8
include_dir : includeDir ,
8
9
gyp : path . join ( includeDir , 'node_api.gyp:nothing' ) , // deprecated.
9
10
targets : path . join ( includeDir , 'node_addon_api.gyp' ) ,
11
+ version,
10
12
isNodeApiBuiltin : true ,
11
13
needsFlag : false
12
14
} ;
Original file line number Diff line number Diff line change 431
431
"fs-extra" : " ^11.1.1" ,
432
432
"path" : " ^0.12.7" ,
433
433
"pre-commit" : " ^1.2.2" ,
434
- "safe-buffer" : " ^5.1.1"
434
+ "safe-buffer" : " ^5.1.1" ,
435
+ "semver" : " ^7.6.0"
435
436
},
436
437
"directories" : {},
437
438
"gypfile" : false ,
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ const { strictEqual } = require ( 'assert' ) ;
4
+ const { valid } = require ( 'semver' ) ;
5
+
6
+ const nodeAddonApi = require ( '../' ) ;
7
+
8
+ module . exports = function test ( ) {
9
+ strictEqual ( nodeAddonApi . include . startsWith ( '"' ) , true ) ;
10
+ strictEqual ( nodeAddonApi . include . endsWith ( '"' ) , true ) ;
11
+ strictEqual ( nodeAddonApi . include . includes ( 'node-addon-api' ) , true ) ;
12
+ strictEqual ( nodeAddonApi . include_dir , '' ) ;
13
+ strictEqual ( nodeAddonApi . gyp , 'node_api.gyp:nothing' ) ;
14
+ strictEqual ( nodeAddonApi . targets , 'node_addon_api.gyp' ) ;
15
+ strictEqual ( valid ( nodeAddonApi . version ) , true ) ;
16
+ strictEqual ( nodeAddonApi . version , require ( '../package.json' ) . version ) ;
17
+ strictEqual ( nodeAddonApi . isNodeApiBuiltin , true ) ;
18
+ strictEqual ( nodeAddonApi . needsFlag , false ) ;
19
+ } ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ if (!dir) {
12
12
process . exit ( 1 ) ;
13
13
}
14
14
15
- const NodeApiVersion = require ( '../package.json ' ) . version ;
15
+ const NodeApiVersion = require ( '../' ) . version ;
16
16
17
17
const disable = args [ 1 ] ;
18
18
let ConfigFileOperations ;
You can’t perform that action at this time.
0 commit comments