Gruntfile.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * decaffeinate suggestions:
  3. * DS102: Remove unnecessary code created because of implicit returns
  4. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  5. */
  6. module.exports = function(grunt) {
  7. // Project configuration.
  8. grunt.initConfig({
  9. forever: {
  10. app: {
  11. options: {
  12. index: 'app.js'
  13. }
  14. }
  15. },
  16. execute: {
  17. app: {
  18. src: 'app.js'
  19. }
  20. },
  21. coffee: {
  22. server: {
  23. expand: true,
  24. flatten: false,
  25. cwd: 'app/coffee',
  26. src: ['**/*.coffee'],
  27. dest: 'app/js/',
  28. ext: '.js'
  29. },
  30. app_server: {
  31. expand: true,
  32. flatten: false,
  33. src: ['app.coffee'],
  34. dest: './',
  35. ext: '.js'
  36. },
  37. unit_tests: {
  38. expand: true,
  39. flatten: false,
  40. cwd: 'test/unit/coffee',
  41. src: ['**/*.coffee'],
  42. dest: 'test/unit/js/',
  43. ext: '.js'
  44. },
  45. acceptance_tests: {
  46. expand: true,
  47. flatten: false,
  48. cwd: 'test/acceptance/coffee',
  49. src: ['**/*.coffee'],
  50. dest: 'test/acceptance/js/',
  51. ext: '.js'
  52. }
  53. },
  54. watch: {
  55. server_coffee: {
  56. files: ['app/**/*.coffee', 'test/unit/**/*.coffee'],
  57. tasks: ['compile:server', 'compile:unit_tests', 'mochaTest']
  58. }
  59. },
  60. clean: ['app/js', 'test/unit/js'],
  61. nodemon: {
  62. dev: {
  63. options: {
  64. file: 'app.js'
  65. }
  66. }
  67. },
  68. concurrent: {
  69. dev: {
  70. tasks: ['nodemon', 'watch'],
  71. options: {
  72. logConcurrentOutput: true
  73. }
  74. }
  75. },
  76. mochaTest: {
  77. unit: {
  78. options: {
  79. reporter: process.env.MOCHA_RUNNER || 'spec',
  80. grep: grunt.option('grep')
  81. },
  82. src: ['test/unit/**/*.js']
  83. },
  84. acceptance: {
  85. options: {
  86. reporter: process.env.MOCHA_RUNNER || 'spec',
  87. grep: grunt.option('grep')
  88. },
  89. src: ['test/acceptance/**/*.js']
  90. }
  91. },
  92. plato: {
  93. your_task: {
  94. files: { plato: ['app/js/**/*.js'] }
  95. }
  96. }
  97. })
  98. grunt.loadNpmTasks('grunt-contrib-coffee')
  99. grunt.loadNpmTasks('grunt-contrib-watch')
  100. grunt.loadNpmTasks('grunt-nodemon')
  101. grunt.loadNpmTasks('grunt-contrib-clean')
  102. grunt.loadNpmTasks('grunt-concurrent')
  103. grunt.loadNpmTasks('grunt-mocha-test')
  104. grunt.loadNpmTasks('grunt-plato')
  105. grunt.loadNpmTasks('grunt-execute')
  106. grunt.loadNpmTasks('grunt-bunyan')
  107. grunt.loadNpmTasks('grunt-forever')
  108. grunt.registerTask('compile', ['clean', 'coffee'])
  109. grunt.registerTask('install', ['compile'])
  110. grunt.registerTask('default', ['compile', 'bunyan', 'execute'])
  111. grunt.registerTask('test:unit', ['compile', 'mochaTest:unit'])
  112. return grunt.registerTask('test:acceptance', [
  113. 'compile:acceptance_tests',
  114. 'mochaTest:acceptance'
  115. ])
  116. }