diff --git a/Makefile.js b/Makefile.js index 54ef7060675..519b9943a7c 100644 --- a/Makefile.js +++ b/Makefile.js @@ -79,7 +79,7 @@ const NODE = "node ", // intentional extra space PERF_MULTIFILES_TARGETS = `"${PERF_MULTIFILES_TARGET_DIR + path.sep}{lib,tests${path.sep}lib}${path.sep}**${path.sep}*.js"`, // Settings - MOCHA_TIMEOUT = 10000; + MOCHA_TIMEOUT = parseInt(process.env.ESLINT_MOCHA_TIMEOUT, 10) || 10000; //------------------------------------------------------------------------------ // Helpers diff --git a/docs/developer-guide/unit-tests.md b/docs/developer-guide/unit-tests.md index 46d77b59076..2968a23805a 100644 --- a/docs/developer-guide/unit-tests.md +++ b/docs/developer-guide/unit-tests.md @@ -37,3 +37,7 @@ Running individual tests is useful when you're working on a specific bug and ite ## More Control on Unit Testing `npm run test:cli` is an alias of the Mocha cli in `./node_modules/.bin/mocha`. [Options](https://mochajs.org/#command-line-usage) are available to be provided to help to better control the test to run. + +The default timeout for tests in `npm test` is 10000ms. You may change the timeout by providing `ESLINT_MOCHA_TIMEOUT` environment variable, for example: + + ESLINT_MOCHA_TIMEOUT=20000 npm test