-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dynamic loader for buffer (#36)
* feat: add dynamic loader for buffer * chore: remove console.logs
- Loading branch information
1 parent
b207ee6
commit 4dab5e1
Showing
3 changed files
with
29 additions
and
4 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,16 @@ | ||
const hyperid = require('..') | ||
const test = require('tape') | ||
const proxyquire = require('proxyquire') | ||
|
||
test('require buffer', function (t) { | ||
t.plan(2); | ||
|
||
const instance = hyperid() | ||
const id = instance() | ||
t.ok(id) | ||
|
||
proxyquire('../hyperid', { 'buffer': { Buffer: null } }); | ||
const instance2 = hyperid() | ||
const id2 = instance2() | ||
t.ok(id2) | ||
}) |