Nutmeg Plundering Muse

    grunt-kobold

    0.9.0 • Public • Published

    Grunt-Kobold

    Grunt plugin for Kobold

    Build Status Coveralls Coverage Code Climate Grade

    NPM Version NPM License

    NPM NPM

    Coverage Report API Documentation

    Gitter Support

    Table of Contents

    Installation

    Install this module with the following command:

    npm install grunt-kobold

    Add the module to your package.json dependencies:

    npm install --save grunt-kobold

    Add the module to your package.json dev-dependencies:

    npm install --save-dev grunt-kobold

    This plugin requires Grunt.

    If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins.

    Getting Started

    Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

    grunt.loadNpmTasks('grunt-kobold');

    The "kobold" task

    Overview

    In your project's Gruntfile, add a section named kobold to the data object passed into grunt.initConfig().

    grunt.initConfig({
        kobold: {
            your_target: {
                // Target-specific Kobold options go here.
            },
        },
    })

    Options

    options.config

    Type: Object --optional--

    Options that would be otherwise in the global config file. You can also require the js or json file instead of adding here all the configurations.

    options.mochaArgs

    Type: String[] --optional--

    List of Mocha arguments that will be passed-through.

    options.approvedFolder

    Type: String --optional-- (default: 'approved')

    Name of the approved folder where Images are defined as approved and how the build images should look like. This can also be the path to a folder.

    options.buildFolder

    Type: String --optional-- (default: 'build')

    Name of the build folder that holds the most recent build images, taken to be compared to the approved images. This can also be the path to a folder.

    options.highlightFolder

    Type: String --optional-- (default: 'highlight')

    Name of the highlight folder that will be used as the result folder, showing all the differences found during visual regression tests. This can also be the path to a folder.

    options.configFolder

    Type: String --optional-- (default: 'config')

    Name of the config folder that describes image specific configurations the overwrite global configuration options that were given with the config property above. This can also be the path to a folder.

    options.failOrphans

    Type: Boolean --optional-- (default: false)

    Defines if a test should fail when a previously approved images is missing from the current build images. This might happen if not all the screenshots could be taken due to an error, or it might simply be removed from the test-cases.

    options.failAdditions

    Type: Boolean --optional-- (default: false)

    Defines if a test should fail when a previously unseen image appears in the build images. You might want to fail these tests to manually approve them; if they are not approved, then they will never be really compared.

    options.testPath

    Type: String --optional-- (default: current working directory)

    Path to directory holding all the test-folders (i.e. approved, build, highlight, and config).

    Usage Examples

    Default Options

    You can supply the configuration in the options object of a task:

    grunt.initConfig({
        kobold: {
            ci: {
                options: {
                    config: require('./config.js')
                }
            }
        }
    })

    Inline Options

    You can supply the configuration inline in the options object of a task:

    grunt.initConfig({
        kobold: {
            ci: {
                options: {
                    config: {
                        "outputBackgroundGreen": 255
                    }
                }
            }
        }
    })

    Here another example, but with more options:

    grunt.initConfig({
     
        kobold: {
      
            ci: {
                options: {
                    config: {
                        "outputBackgroundGreen": 255
                    },
                    
                    highlightFolder: "result",
                    
                    failOrphans: true,
                    failAdditions: true
                }
            }
        }
    })

    Third-party libraries

    The following third-party libraries are used by this module:

    Dependencies

    Dev-Dependencies

    License

    The MIT License

    Copyright 2015 Marcel Erz

    Install

    npm i grunt-kobold

    DownloadsWeekly Downloads

    2

    Version

    0.9.0

    License

    MIT

    Last publish

    Collaborators

    • marcelerz