Gruntfile.js内容:
grunt.initConfig({
connect: {
server: {
options: {
port: 5005,
base: '.'
}
}
},
qunit: {
all: ['test/*.html']
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.registerTask('test', ['connect', 'qunit']);Test/index.html文件内容:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
Sitejson - QUnit Test Runner
</title>
<link rel="stylesheet" href="libs/qunit/qunit.css" type="text/css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="libs/qunit/qunit.js" type="text/javascript"></script>
<script src="testcases/tests.js" type="text/javascript"></script>
</body>
</html>tests.js内容:
QUnit.test("hello test", function(assert) {
assert.ok(1 == "1", "Passed!");
});我正在开发Ubuntu / Linux环境。我还安装了Phantomjs,运行良好。每当我尝试运行咕噜测试时,我都会收到一个致命的错误:产生ENOENT错误。
我试着在浏览器上运行它,它的qunit运行得很好.
我无法确定是什么问题。我是不是错过了更多的配置。
咕噜测试--调试告诉我:
Running "connect:server" (connect) task
[D] Task source: /media/hegdeashwin/Storage-TB/qunittesting/node_modules/grunt-contrib-connect/tasks/connect.js
Started connect web server on http://0.0.0.0:5005
Running "qunit:all" (qunit) task
[D] Task source: /media/hegdeashwin/Storage-TB/qunittesting/node_modules/grunt-contrib-qunit/tasks/qunit.js
Testing test/index.html [D] ["/media/hegdeashwin/Storage-TB/qunittesting/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/phantomjs/main.js","/tmp/1405775714604.2773","test/index.html","{\"timeout\":5000,\"inject\":\"/media/hegdeashwin/Storage-TB/qunittesting/node_modules/grunt-contrib-qunit/phantomjs/bridge.js\",\"urls\":[],\"force\":false,\"console\":true,\"httpBase\":false}"]
Fatal error: spawn EACCES发布于 2015-04-19 05:37:05
使用以下过程:
tmpdir环境变量:
setenv TMPDIR=~/tmpgrunt任务.bashrc或.profile中,将其永久设置:
出口TMPDIR=~/tmp参考资料
https://stackoverflow.com/questions/24840832
复制相似问题