UNPKG

1.93 kBtext/coffeescriptView Raw
1'use strict'
2
3module.exports = (grunt) ->
4
5 require 'coffee-errors'
6
7 grunt.loadNpmTasks 'grunt-contrib-coffee'
8 grunt.loadNpmTasks 'grunt-contrib-watch'
9 grunt.loadNpmTasks 'grunt-coffeelint'
10 grunt.loadNpmTasks 'grunt-simple-mocha'
11 grunt.loadNpmTasks 'grunt-notify'
12
13 grunt.registerTask 'test', [ 'coffeelint', 'coffee', 'simplemocha' ]
14 grunt.registerTask 'default', [ 'test', 'watch' ]
15
16 grunt.initConfig
17
18 coffeelint:
19 options:
20 max_line_length:
21 value: 79
22 indentation:
23 value: 2
24 newlines_after_classes:
25 level: 'error'
26 no_empty_param_list:
27 level: 'error'
28 no_unnecessary_fat_arrows:
29 level: 'ignore'
30 dist:
31 files: [
32 { expand: yes, cwd: 'src/', src: [ '**/*.coffee' ] }
33 { expand: yes, cwd: 'tests/', src: [ '**/*.coffee' ] }
34 { expand: yes, cwd: 'samples/chat/coffee/', src: [ '**/*.coffee' ] }
35 { expand: yes, cwd: 'samples/job-queue/coffee/', src: [ '**/*.coffee' ] }
36 ]
37
38 coffee:
39 dist:
40 files: [{
41 expand: yes
42 cwd: 'src/'
43 src: [ '**/*.coffee' ]
44 dest: 'lib/'
45 ext: '.js'
46 }
47 {
48 expand: yes
49 cwd: 'samples/chat/coffee/'
50 src: [ '**/*.coffee' ]
51 dest: 'samples/chat/js/'
52 ext: '.js'
53 }
54 {
55 expand: yes
56 cwd: 'samples/job-queue/coffee/'
57 src: [ '**/*.coffee' ]
58 dest: 'samples/job-queue/js/'
59 ext: '.js'
60 }]
61
62 simplemocha:
63 options:
64 ui: 'bdd'
65 reporter: 'spec'
66 compilers: 'coffee:coffee-script'
67 ignoreLeaks: no
68 dist:
69 src: [ 'tests/test_*.coffee' ]
70
71 watch:
72 options:
73 interrupt: yes
74 dist:
75 files: [ 'src/**/*.coffee', 'tests/**/*.coffee', 'samples/**/*.coffee' ]
76 tasks: [ 'test' ]