我正在使用 Grunt 对我的响应式网站进行测试。Grunt-contrib-jasmine 正在使用 PhantomJS 来运行网页。我注意到默认的视口宽度是 400px。但是我也想测试我的大屏幕行为。如何更改 PhantomJS 的视口宽度?
非常感谢。
我的 Gruntfile.js
module.exports = function (grunt) {
grunt.initConfig({
cssmin: {
css: {
src: 'css/common/page.css',
dest: 'css/common/page.min.css'
}
},
jshint: {
options: {
browser: true,
curly: true,
eqeqeq: true,
eqnull: true,
funcscope: true,
globals: {
jQuery: true
},
loopfunc: true,
reporter: require('jshint-stylish'),
smarttabs: true,
shadow: true
},
all: ['Gruntfile.js', 'js/default.j s', 'js/utils.js', 'tests/jasmine-standalone-2.0.0/spec/*.js']
},
jasmine: {
obpjs: {
src: 'tests/jasmine-standalone-2.0.0/src/*.js',
options: {
specs: 'tests/jasmine-standalone-2.0.0/spec/CommonSpec.js',
vendor: ['js/extlib.min.js', 'tests/jasmine-jquery/jasmine-jquery.js'],
helpers: ['js/utils.js', 'js/default.js'],
styles: 'css/common/page.min.css',
summary: true,
keepRunner: true
}
}
},
watch: {
script: {
files: ['js/default.js', 'js/utils.js'],
tasks: ['jshint']
},
styles: {
files: ['css/common/page.css'],
tasks: ['cssmin']
},
tests: {
files: ['js/default.js', 'js/utils.js', 'tests/jasmine-standalone-2.0.0/spec/*.js'],
tasks: ['jshint', 'jasmine']
}
}
});
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['jshint', 'jasmine']);
grunt.registerTask('build', ['cssmin', 'jshint', 'jasmine']);
};