Gruntfile.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 'use strict';
  2. module.exports = function (grunt) {
  3. grunt.loadNpmTasks('grunt-contrib-jshint');
  4. grunt.loadNpmTasks('grunt-contrib-watch');
  5. grunt.loadNpmTasks('grunt-simple-mocha');
  6. grunt.initConfig({
  7. jshint: {
  8. files: [
  9. 'Gruntfile.js',
  10. 'lib/**/*.js',
  11. 'test/**/*.js'
  12. ],
  13. options: {
  14. jshintrc: '.jshintrc'
  15. }
  16. },
  17. simplemocha: {
  18. options: {
  19. reporter: 'spec',
  20. timeout: 20000
  21. },
  22. full: {
  23. src: ['test/runner.js']
  24. },
  25. short: {
  26. options: {
  27. reporter: 'dot'
  28. },
  29. src: ['test/runner.js']
  30. },
  31. build: {
  32. options: {
  33. reporter: 'tap'
  34. },
  35. src: ['test/runner.js']
  36. }
  37. },
  38. watch: {
  39. files: ['<%= jshint.files %>'],
  40. tasks: ['jshint', 'simplemocha:short']
  41. }
  42. });
  43. grunt.registerTask('test', ['simplemocha:full']);
  44. grunt.registerTask('default', ['jshint', 'test']);
  45. };