TOGOUTECH

grunt-contrib-qunit

全部标签

javascript - 如何为 requirejs 和 qunit 设置 grunt 任务

我正在尝试使用requirejs和grunt-contrib-qunit设置QUnit环境。这是我的。咕噜文件:qunit:{all:{options:{urls:['http://localhost:8000/qunit/qunit-test-suite.html']}}},connect:{server:{options:{port:8000,base:'.'}}},qunit-test-suite.html:<!DOCTYPEhtml><html><head><metacharset="utf-8&

javascript - 在 QUnit 测试中设置 PhantomJS viewportSize

我需要在不同的视口(viewport)尺寸下测试我的脚本。在我的测试中,我想通过设置page.viewportSize来更改PhantomJS的视口(viewport)大小。我正在通过grunt-contrib-qunit运行测试,但在我的测试代码中无法访问PhantomJS。有没有办法访问它? 最佳答案 现在在dist版本上是不可能的。grunt-contrib-qunit依赖于grunt-lib-phantomjs,它不允许这个特性。但是,aninterestingcommit(6天前)来自github上的bdowling可用。