Skip to content

Commit

Permalink
Copy Suite root; closes #3847
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Mar 25, 2019
1 parent 586bf78 commit 73f5be8
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 73f5be8

Please sign in to comment.