test.js 539 B

1234567891011121314151617181920
  1. 'use strict';
  2. const { spawnSync } = require('child_process');
  3. const { readdirSync } = require('fs');
  4. const { join } = require('path');
  5. const files = readdirSync(__dirname).sort();
  6. for (const filename of files) {
  7. if (filename.startsWith('test-')) {
  8. const path = join(__dirname, filename);
  9. console.log(`> Running ${filename} ...`);
  10. const result = spawnSync(`${process.argv0} ${path}`, {
  11. shell: true,
  12. stdio: 'inherit',
  13. windowsHide: true
  14. });
  15. if (result.status !== 0)
  16. process.exitCode = 1;
  17. }
  18. }