task-test-get-files.js 578 B

12345678910111213141516171819
  1. // ignores the proxy tests
  2. const { internalTask } = require('hardhat/config');
  3. const { TASK_TEST_GET_TEST_FILES } = require('hardhat/builtin-tasks/task-names');
  4. const glob = require('glob');
  5. const path = require('path');
  6. const { promisify } = require('util');
  7. internalTask(TASK_TEST_GET_TEST_FILES)
  8. .setAction(async ({ testFiles }, { config }) => {
  9. if (testFiles.length !== 0) {
  10. return testFiles;
  11. }
  12. return await promisify(glob)(
  13. path.join(config.paths.tests, '**/*.js'),
  14. { ignore: [path.join(config.paths.tests, 'proxy/**/*')] },
  15. );
  16. });