diff --git a/test/runner/timeout_test.js b/test/runner/timeout_test.js index fc4fb3768..64090acb8 100644 --- a/test/runner/timeout_test.js +++ b/test/runner/timeout_test.js @@ -9,14 +9,14 @@ const config_run_config = (config, grep, verbose = false) => `${codecept_run} ${ describe('CodeceptJS Timeouts', function () { this.timeout(10000) - // some times messages are different - this.retries(2); + // some times messages are different + this.retries(2) it('should stop test when timeout exceeded', done => { exec(config_run_config('codecept.conf.js', 'timed out'), (err, stdout) => { debug_this_test && console.log(stdout) - expect(stdout).toContain('Timeout 2s exceeded') - expect(stdout).toContain('Timeout 1s exceeded') + expect(stdout).toContain('Timeout 2s exceeded (with Before hook)') + expect(stdout).toContain('Timeout 1s exceeded (with Before hook)') expect(err).toBeTruthy() done() }) @@ -26,8 +26,8 @@ describe('CodeceptJS Timeouts', function () { exec(`${config_run_config('codecept.conf.js', 'timed out')} --no-timeouts`, (err, stdout) => { debug_this_test && console.log(stdout) expect(stdout).toContain('Timeouts were disabled') - expect(stdout).not.toContain('Timeout 2s exceeded') - expect(stdout).not.toContain('Timeout 1s exceeded') + expect(stdout).not.toContain('Timeout 2s exceeded (with Before hook)') + expect(stdout).not.toContain('Timeout 1s exceeded (with Before hook)') expect(err).toBeFalsy() done() }) @@ -74,7 +74,7 @@ describe('CodeceptJS Timeouts', function () { it('should override timeout config from global object', done => { exec(config_run_config('codecept.timeout.obj.conf.js', '#first', false), (err, stdout) => { debug_this_test && console.log(stdout) - expect(stdout).toContain('Timeout 0.3s exceeded') + expect(stdout).toContain('Timeout 0.3s exceeded (with Before hook)') expect(err).toBeTruthy() done() }) @@ -83,8 +83,8 @@ describe('CodeceptJS Timeouts', function () { it('should override timeout config from global object but respect local value', done => { exec(config_run_config('codecept.timeout.obj.conf.js', '#second'), (err, stdout) => { debug_this_test && console.log(stdout) - expect(stdout).not.toContain('Timeout 0.3s exceeded') - expect(stdout).toContain('Timeout 0.5s exceeded') + expect(stdout).not.toContain('Timeout 0.3s exceeded (with Before hook)') + expect(stdout).toContain('Timeout 0.5s exceeded (with Before hook)') expect(err).toBeTruthy() done() }) @@ -93,8 +93,8 @@ describe('CodeceptJS Timeouts', function () { it('should respect grep when overriding config from global config', done => { exec(config_run_config('codecept.timeout.obj.conf.js', '#fourth'), (err, stdout) => { debug_this_test && console.log(stdout) - expect(stdout).not.toContain('Timeout 0.3s exceeded') - expect(stdout).toContain('Timeout 1s exceeded') + expect(stdout).not.toContain('Timeout 0.3s exceeded (with Before hook)') + expect(stdout).toContain('Timeout 1s exceeded (with Before hook)') expect(err).toBeTruthy() done() })