Skip to content

Commit c877a18

Browse files
committedNov 20, 2018
Use lodash.deepClone in place of Hoek.clone until it's fixed.
1 parent 9db5dee commit c877a18

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed
 

‎lib/reporters/multiple.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Load modules
44

5-
const Hoek = require('hoek');
5+
const { cloneDeep } = require('lodash');
66
const Reporters = require('./index');
77

88

@@ -17,7 +17,7 @@ exports = module.exports = internals.Reporter = function (options) {
1717

1818
options.reporter.forEach((reporter, index) => {
1919

20-
const reporterOptions = Hoek.clone(options);
20+
const reporterOptions = cloneDeep(options);
2121
reporterOptions.reporter = reporter;
2222

2323
if (options.output[index] === 'stdout') {

‎lib/runner.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Load modules
44

55
const Hoek = require('hoek');
6+
const { cloneDeep } = require('lodash');
67
const Seedrandom = require('seedrandom');
78
const WillCall = require('will-call');
89
const Reporters = require('./reporters');
@@ -263,7 +264,7 @@ internals.executeExperiments = async function (experiments, state, skip, parentC
263264
for (const experiment of experiments) {
264265
const skipExperiment = skip || experiment.options.skip || !internals.experimentHasTests(experiment, state) || (state.options.bail && state.report.failures);
265266

266-
state.currentContext = parentContext ? Hoek.clone(parentContext) : {};
267+
state.currentContext = parentContext ? cloneDeep(parentContext) : {};
267268

268269
// Before
269270

@@ -371,7 +372,7 @@ internals.executeTests = async function (experiment, state, skip) {
371372

372373
const start = Date.now();
373374
try {
374-
test.context = Hoek.clone(state.currentContext);
375+
test.context = cloneDeep(state.currentContext);
375376
await internals.protect(test, state);
376377
}
377378
catch (ex) {

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"hoek": "6.x.x",
2020
"json-stable-stringify": "1.x.x",
2121
"json-stringify-safe": "5.x.x",
22+
"lodash": "^4.17.x",
2223
"mkdirp": "0.5.x",
2324
"seedrandom": "2.4.x",
2425
"source-map": "0.7.x",

0 commit comments

Comments
 (0)
Please sign in to comment.