jasmine.js 821 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env node
  2. const path = require('path');
  3. const os = require('os');
  4. const Command = require('../lib/command');
  5. const Jasmine = require('../lib/jasmine');
  6. let projectBaseDir = path.resolve();
  7. if (os.platform() === 'win32') {
  8. // Future versions of glob will interpret backslashes as escape sequences on
  9. // all platforms, and Jasmine warns about them. Convert to slashes to avoid
  10. // the warning and future behavior change.
  11. projectBaseDir = projectBaseDir.replace(/\\/g, '/');
  12. }
  13. const jasmine = new Jasmine({ projectBaseDir });
  14. const examplesDir = path.join(path.dirname(require.resolve('jasmine-core')), 'jasmine-core', 'example', 'node_example');
  15. const command = new Command(path.resolve(), examplesDir, {
  16. print: console.log,
  17. platform: os.platform,
  18. });
  19. command.run(jasmine, process.argv.slice(2));