logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

runner.js (1015B)


  1. // 1. start the dev server using production config
  2. process.env.NODE_ENV = 'testing'
  3. const server = require('../../build/dev-server.js')
  4. // 2. run the nightwatch test suite against it
  5. // to run in additional browsers:
  6. // 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings"
  7. // 2. add it to the --env flag below
  8. // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
  9. // For more information on Nightwatch's config file, see
  10. // http://nightwatchjs.org/guide#settings-file
  11. let opts = process.argv.slice(2)
  12. if (opts.indexOf('--config') === -1) {
  13. opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
  14. }
  15. if (opts.indexOf('--env') === -1) {
  16. opts = opts.concat(['--env', 'chrome'])
  17. }
  18. const spawn = require('cross-spawn')
  19. const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
  20. runner.on('exit', function (code) {
  21. server.close()
  22. process.exit(code)
  23. })
  24. runner.on('error', function (err) {
  25. server.close()
  26. throw err
  27. })