7

I cannot find anywhere that it is documented for ember-cli to set a global timeout for QUnit.

I have found the documentation for QUnit: https://api.qunitjs.com/QUnit.config/

testTimeout (default: undefined) Type: Number Specify a global timeout in milliseconds after which all tests will fail with an appropriate message. Useful when async tests aren't finishing, to prevent the testrunner getting stuck. Set to something high, e.g. 30000 (30 seconds) to avoid slow tests to time out by accident.

I was able to change this inside of \node_modules\ember-cli-qunit\vendor\ember-cli-qunit\qunit-configuration.js and this works as expected.

However, we do not check in the node_modules to source control, so changing this value here doesn't really do me any good.

I'm at a loss here on where I'm supposed to make a change to get a global test timeout in ember-cli.

Michiel Bugher
  • 1,005
  • 1
  • 7
  • 23

2 Answers2

11

This can be done within the //tests/test-helper.js file.

QUnit.config.testTimeout = 60000;

Michiel Bugher
  • 1,005
  • 1
  • 7
  • 23
  • 7
    For some who might not know better, make sure to import QUnit: `import QUnit from 'qunit';` then set your time out value. Thanks gang. – Dan Aug 22 '16 at 15:12
2

In tests.index.html
right after the line that says:

<script src="assets/test-support.js"></script>

Add:

<script>
  QUnit.config.testTimeout = 6400; // Why not 6400? This is a nice number
</script>
Tal Weiss
  • 8,889
  • 8
  • 54
  • 62