jasmine-run.mjs 631 B

1234567891011121314151617181920212223
  1. import glob from 'glob';
  2. import Jasmine from 'jasmine';
  3. const jasmine = new Jasmine();
  4. jasmine.loadConfigFile('test/jasmine.json');
  5. const pattern = process.argv[2] || 'test/spec/*.js';
  6. // Load your specs
  7. glob(pattern, function (er, files) {
  8. Promise.all(
  9. files
  10. // Use relative paths
  11. .map(f => f.replace(/^([^\/])/, './$1'))
  12. .map(f => import(f)
  13. .catch(e => {
  14. console.error('** Error loading ' + f + ': ');
  15. console.error(e);
  16. process.exit(1);
  17. }))
  18. )
  19. .then(() => jasmine.execute());
  20. });