From 73f5be8b2a03541897c63bf16043b5421d1790a2 Mon Sep 17 00:00:00 2001 From: Carl-Erik Kopseng Date: Mon, 25 Mar 2019 20:32:04 +0100 Subject: [PATCH] Copy Suite root; closes #3847 --- lib/suite.js | 1 + test/unit/suite.spec.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/suite.js b/lib/suite.js index 6d1d0fb56e..191d946b50 100644 --- a/lib/suite.js +++ b/lib/suite.js @@ -102,6 +102,7 @@ Suite.prototype.clone = function() { var suite = new Suite(this.title); debug('clone'); suite.ctx = this.ctx; + suite.root = this.root; suite.timeout(this.timeout()); suite.retries(this.retries()); suite.enableTimeouts(this.enableTimeouts()); diff --git a/test/unit/suite.spec.js b/test/unit/suite.spec.js index 2a1d639c53..1be948e1c6 100644 --- a/test/unit/suite.spec.js +++ b/test/unit/suite.spec.js @@ -23,7 +23,7 @@ describe('Suite', function() { describe('.clone()', function() { beforeEach(function() { - this.suite = new Suite('To be cloned'); + this.suite = new Suite('To be cloned', {}, true); this.suite._timeout = 3043; this.suite._slow = 101; this.suite._bail = true; @@ -74,6 +74,10 @@ describe('Suite', function() { it('should not copy the values from the _afterAll array', function() { expect(this.suite.clone()._afterAll, 'to be empty'); }); + + it('should copy the root property', function() { + expect(this.suite.clone().root, 'to be', true); + }); }); describe('.timeout()', function() {