[英]How to run npm test after npm start in bash script
In my docker file, I want to run test script inside it after app is up in Docker dev version. 在我的docker文件中,我想在Docker dev版本中启动应用程序后在其中运行测试脚本。 Problem is when I created a bash script and add like that,
test
script is not working. 问题是当我创建一个bash脚本并添加类似内容时,
test
脚本无法正常工作。
Here is my package json file: 这是我的包json文件:
"scripts": {
"build": "./node_modules/babel-cli/bin/babel.js src --out-dir lib --copy-files lib --plugins transform-react-jsx --presets es2015",
"bundle": "./node_modules/browserify/bin/cmd.js lib/client.js -o public/js/bundle.js",
"start": "npm run build && npm run bundle && node lib/server.js",
"test": "mocha ./src/*.test.js"
},
and here is bash script file 这是bash脚本文件
#!/bin/bash
npm start
npm run start
npm test
npm run test
Please let me know how to fix it, thanks much. 非常感谢,请让我知道如何解决它。
#!/bin/bash
npm run build
npm run bundle
forever start ./lib/server.js
npm test
I've found solution that I need to install forever
or pm2
first. 我找到了需要
forever
安装或首先安装pm2
解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.