大佬教程收集整理的这篇文章主要介绍了如何在CI中运行cypress之前提供角度cli应用程序?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在本地运行时测试工作正常,因为在这里我可以在运行cypress测试之前启动serve命令.
"cypress:run:report": "./node_modules/.bin/cypress run --record --key <key>","cypress:run:ci": "start-server-and-test serve:dev http://localhost:4200 cypress:run:report","cypress:run:ci2": "npm run -s serve:dev & npm run -s cypress:run:report",
提前致谢.
的package.json
"cypress:run:ci": "node ng-serve-and-run-cypress.js",
NG-发球和运行柏树
'use Strict'; const cypress = require('cypress'); const { spawn } = require('child_process'); const child = spawn('ng',['serve']); // On error exit,and print child.on('error',(err) => process.exit(1)); child.stderr.on('data',(data) => console.log(data.toString())); // On exit,print exit code child.on('exit',(code,signal) => console.log(`Child exitTing with code ${CodE}`)); child.stdout.on('data',(data) => { const asString = data.toString(); // Log the output to inform CI/User console.log(asString); if (asString.includes('webpack: Compiled successfully.')) { cypress.run({}) .then((results) => { const errorCode = (results.@R_428_4895@ >= 1) ? 1 : 0; child.kill(); // When cypress is done running the tests,exit with errorCode from above. process.exit(errorCodE); }) .catch((err) => { child.kill(); // If cypress hit's an error,exit with code 1 process.exit(1); }) } });
如果您对更多细节感兴趣,请在此处发布.
以上是大佬教程为你收集整理的如何在CI中运行cypress之前提供角度cli应用程序?全部内容,希望文章能够帮你解决如何在CI中运行cypress之前提供角度cli应用程序?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。