aboutsummaryrefslogtreecommitdiff
path: root/guidelines/wikipedia/Gruntfile.js
blob: 69f1954eea7e3d7d81b11b0c30c79a17b720a6a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*global module:false*/
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      gruntfile: {
        jshintrc: true,
        src: 'Gruntfile.js'
      },
      src_specs: {
        jshintrc: true,
        src: ['src/**/*.js', 'test/**/*.js']
      }
    },
    jasmine: {
      guidelines: {
        src: 'src/**/*.js',
        options: {
          vendor: [
            '../../src/js/lib/underscore.js',
            '../../src/js/lib/jquery/jquery-1.8.3.js',
            '../../src/js/lib/md5.js',
            '../../src/js/fiveui/injected/prelude.js',
            '../../src/js/lib/injected/jquery-plugins.js',
            '../../src/js/lib/injected/compute.js'
          ],
          helpers: ['specs/exports.js', 'specs/*_helper.js'],
          specs: 'specs/*_spec.js',
          host: 'http://localhost:<%= connect.server.options.port %>/guidelines/wikipedia'
        }
      }
    },
    connect: {
      server: {
        options: {
          port: 9867,
          base: '../..'
        }
      }
    },
    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      src_specs: {
        files: '<%= jshint.src_specs.src %>',
        tasks: ['jshint:src_specs', 'test']
      }
    }
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');

  // Default task.
  grunt.registerTask('default', ['jshint', 'test']);

  grunt.registerTask('test', ['connect:server', 'jasmine:guidelines']);

};