You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 line
574 B

  1. process.env.NODE_ENV = "testing";
  2. var child_process = require("child_process");
  3. var server = require("../../server.js");
  4. server.ready.then(() => {
  5. var opts = process.argv.slice(2);
  6. if (opts.indexOf("--config") === -1) {
  7. opts = opts.concat(["--config", "test/e2e/nightwatch.conf.js"]);
  8. }
  9. var runner = child_process.spawn("./node_modules/.bin/nightwatch", opts, {
  10. stdio: "inherit"
  11. });
  12. runner.on("exit", function(code) {
  13. server.close();
  14. process.exit(code);
  15. });
  16. runner.on("error", function(err) {
  17. server.close();
  18. throw err;
  19. });
  20. });