forked from node-config/node-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conversion of Uint8Array to object (node-config#761)
- Loading branch information
1 parent
fb5033d
commit 0efbb5a
Showing
4 changed files
with
58 additions
and
3 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,23 @@ | ||
var requireUncached = require('./_utils/requireUncached'); | ||
require('../parser'); | ||
|
||
'use strict'; | ||
|
||
var vows = require('vows'), | ||
assert = require('assert'); | ||
|
||
vows.describe('Tests for parsing binary data') | ||
.addBatch({ | ||
'Using the YAML parser - Uint8Array': { | ||
topic: function() { | ||
process.env.NODE_CONFIG_DIR = __dirname + '/22-binary'; | ||
return requireUncached(__dirname + '/../lib/config'); | ||
}, | ||
'reading !!binary returns a real Uint8Array': function(CONFIG) { | ||
assert.deepStrictEqual(CONFIG.get('auth'), { | ||
secret: new Uint8Array([0x10, 0x11, 0x12, 0x13, 0x14, 0x15]) | ||
}); | ||
}, | ||
} | ||
}) | ||
.export(module); |
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,2 @@ | ||
auth: | ||
secret: !!binary 'EBESExQV' |