-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "add test case for clone function"
This reverts commit 88aa12e.
- Loading branch information
Emman
committed
Nov 9, 2020
1 parent
88aa12e
commit 917bfec
Showing
3 changed files
with
23 additions
and
34 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,21 @@ | ||
'use strict'; | ||
|
||
const rewire = require('rewire'); | ||
const _cloneOptions = rewire('../').__get__('_cloneOptions'); | ||
const http = require('http'); | ||
const t = require('chai').assert; | ||
|
||
describe('Clone option function', function () { | ||
it('should not clone agent and non-own properties', function (done) { | ||
const options = Object.create({ parent: true }); | ||
options.cloneable = { a: 1 }; | ||
options.agent = new http.Agent({ keepAlive: true }); | ||
const cloned = _cloneOptions(options); | ||
t.strictEqual(options.agent, cloned.agent); | ||
t.notStrictEqual(options.cloneable, cloned.cloneable); | ||
t.equal(options.cloneable.a, cloned.cloneable.a) | ||
t.isUndefined(cloned.parent); | ||
t.isTrue(options.parent); | ||
done(); | ||
}); | ||
}); |
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