3

Grunt を使用してレスポンシブ Web サイトのテストを実行しています。Grunt-contrib-jasmine は PhantomJS を使用して Web ページを実行しています。デフォルトのビューポート幅が 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']);
};
4

1 に答える 1