qunitjs/node-qunit

grunt-node-qunit

Closed this issue · 5 comments

Instead of:

exec: {
    qunit: {
        command: 'node node_modules/qunit/bin/cli.js ' +
            '--log "{ summary: true, errors: true }" ' +
            '--code ./file.js ' +
            '--tests ./tests/file.js'
    }
}

grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('qunit', 'exec:qunit');
grunt.registerTask('test', ['exec:qunit']);

I'd like to write like:

qunit: {
    setup: {
        log: {
            {
                summary: true,
                errors:  true
            }
        }
    },

    run: {
        code:  './file.js',
        tests: './tests/file.js'
    }
}

grunt.loadNpmTasks('grunt-node-qunit');
grunt.registerTask('test', ['qunit']);
kof commented

I am not using grunt yet, but you could use the api for this instead of cli I think?

Of course, but using Grunt is more convenient 😊

kof commented

Oh, I thought you are writing a grunt plugin, you might want to use one for this?

https://github.com/axemclion/grunt-node-qunit

Hm, thanks, I did not know about the one!

kof commented

ok let me know if there are still problems.