cedmax / grunt-qunit-amd

[deprecated] Grunt plugin to run Qunit tests on your AMD libraries without having to create html pages.
MIT License
4 stars 2 forks source link

Shims #4

Closed PunkChameleon closed 11 years ago

PunkChameleon commented 11 years ago

Is there a way to configure shims in this plugin? Would that just be configured on the RequireJS side? (Great plugin by the way!)

cedmax commented 11 years ago

thank you :)

you should be able to configure shims in the 'require' configuration object:

grunt.initConfig({
    qunit_amd: {
        unit: function(test){
            var config = {
                include: [
                    'test/lib/helper.js',
                    'test/lib/sinon-1.5.1.js'
                ],
                require: {
                    baseUrl: 'assets/javascripts/src',
                    paths: {
                        jquery: 'public/javascripts/jquery-2.0.0.min',
                        mustache: 'public/javascripts/mustache',
                    },
                    shim: { 
                        //your shims 
                    }
                }
            }
            if (test) {
                config.tests = ["test/assets/unit/"+test+".js"];
            } else {
                config.tests = ["test/assets/unit/*.js"];
            }
            return config;
        }
    }
})

let me know if you have any trouble with that