Skip to content

Commit

Permalink
Copy Suite property "root" when cloning; closes #3847 (#3848)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 authored and juergba committed Mar 31, 2019
1 parent 8aa2fc4 commit 81cfa90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/suite.js
Expand Up @@ -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());
Expand Down
6 changes: 5 additions & 1 deletion test/unit/suite.spec.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 81cfa90

Please sign in to comment.