-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): export the package version
As kerberos can be used as an optional dependency, we expose the version at api level to allow third party libraries to consume the version number easily. It includes a test that verifies what's being exported.
- Loading branch information
1 parent
cd1db13
commit 5be618f
Showing
2 changed files
with
42 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
|
||
const chai = require('chai'); | ||
const expect = chai.expect; | ||
const api = require('../index'); | ||
|
||
describe('module', function () { | ||
it('should export version', function () { | ||
expect(api.version).to.be.a('string'); | ||
expect(api.version).to.match(/\d+\.\d+/); | ||
}); | ||
|
||
it('should export flags and ids', function () { | ||
[ | ||
api.GSS_C_DELEG_FLAG, | ||
api.GSS_C_MUTUAL_FLAG, | ||
api.GSS_C_REPLAY_FLAG, | ||
api.GSS_C_SEQUENCE_FLAG, | ||
api.GSS_C_CONF_FLAG, | ||
api.GSS_C_INTEG_FLAG, | ||
api.GSS_C_ANON_FLAG, | ||
api.GSS_C_PROT_READY_FLAG, | ||
api.GSS_C_TRANS_FLAG, | ||
api.GSS_C_NO_OID, | ||
api.GSS_MECH_OID_KRB5, | ||
api.GSS_MECH_OID_SPNEGO | ||
].forEach(flag => expect(flag).to.be.a('number')); | ||
}); | ||
|
||
it('should export functions', function () { | ||
expect(api.initializeClient).to.be.a('function'); | ||
expect(api.initializeServer).to.be.a('function'); | ||
expect(api.principalDetails).to.be.a('function'); | ||
expect(api.checkPassword).to.be.a('function'); | ||
}); | ||
|
||
it('should export Kerberos', () => { | ||
expect(api.Kerberos).to.be.an('object'); | ||
}); | ||
}); |