-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose version property in public API (#1479)
This value is already used in the conversion tooling and is useful in external contexts too, for example when specifying/detecting node-addon-api as an optional peer dependency. Also adds test expectations for all exported properties.
- Loading branch information
Showing
4 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
const { strictEqual } = require('assert'); | ||
const { valid } = require('semver'); | ||
|
||
const nodeAddonApi = require('../'); | ||
|
||
module.exports = function test () { | ||
strictEqual(nodeAddonApi.include.startsWith('"'), true); | ||
strictEqual(nodeAddonApi.include.endsWith('"'), true); | ||
strictEqual(nodeAddonApi.include.includes('node-addon-api'), true); | ||
strictEqual(nodeAddonApi.include_dir, ''); | ||
strictEqual(nodeAddonApi.gyp, 'node_api.gyp:nothing'); | ||
strictEqual(nodeAddonApi.targets, 'node_addon_api.gyp'); | ||
strictEqual(valid(nodeAddonApi.version), true); | ||
strictEqual(nodeAddonApi.version, require('../package.json').version); | ||
strictEqual(nodeAddonApi.isNodeApiBuiltin, true); | ||
strictEqual(nodeAddonApi.needsFlag, false); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters