Gruntfile.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * grunt-lib-contrib
  3. * http://gruntjs.com/
  4. *
  5. * Copyright (c) 2012 Tyler Kellen, contributors
  6. * Licensed under the MIT license.
  7. */
  8. module.exports = function(grunt) {
  9. 'use strict';
  10. // Project configuration.
  11. grunt.initConfig({
  12. jshint: {
  13. all: [
  14. 'Gruntfile.js',
  15. 'lib/*.js',
  16. '<%= nodeunit.tests %>'
  17. ],
  18. options: {
  19. jshintrc: '.jshintrc'
  20. }
  21. },
  22. test_vars: {
  23. source: 'source/'
  24. },
  25. test_task: {
  26. options: {
  27. param: 'task',
  28. param2: 'task',
  29. template: '<%= test_vars.source %>',
  30. data: {
  31. template: ['<%= test_vars.source %>']
  32. }
  33. },
  34. target: {
  35. options: {
  36. param: 'target'
  37. }
  38. }
  39. },
  40. // Unit tests.
  41. nodeunit: {
  42. tests: ['test/*_test.js']
  43. }
  44. });
  45. // These plugins provide necessary tasks.
  46. grunt.loadNpmTasks('grunt-contrib-jshint');
  47. grunt.loadNpmTasks('grunt-contrib-nodeunit');
  48. // Whenever the "test" task is run, then test the result.
  49. grunt.registerTask('test', ['nodeunit']);
  50. // By default, lint and run all tests.
  51. grunt.registerTask('default', ['jshint', 'test']);
  52. };