Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy Suite root when cloning #3848

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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