You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.3 KiB

  1. 'use strict';
  2. module.exports = function (grunt) {
  3. require('time-grunt')(grunt);
  4. grunt.initConfig({
  5. browserify: {
  6. browser: {
  7. src: [ require('./package.json').main ],
  8. dest: './browser/shortid.js'
  9. },
  10. tests: {
  11. src: [
  12. './test/**/*.test.js'
  13. ],
  14. dest: './browser/shortid.test.js'
  15. }
  16. },
  17. open: {
  18. test: {
  19. path: './test/index.html',
  20. app: 'Google Chrome'
  21. }
  22. },
  23. mochaTest: {
  24. notify: {
  25. src: 'test/**/*.test.js',
  26. options: {
  27. reporter: 'spec',
  28. timeout: 50000
  29. }
  30. }
  31. },
  32. jshint: {
  33. options: {
  34. jshintrc: '.jshintrc'
  35. },
  36. all: [
  37. 'Gruntfile.js',
  38. 'lib/**/*.js',
  39. 'tests/*'
  40. ]
  41. }
  42. });
  43. require('load-grunt-tasks')(grunt);
  44. grunt.registerTask('build', [
  45. 'browserify'
  46. ]);
  47. grunt.registerTask('test', [
  48. 'jshint',
  49. 'mochaTest'
  50. ]);
  51. grunt.registerTask('default', [
  52. 'build',
  53. 'test'
  54. ]);
  55. };