UNPKG

1.15 kBJavaScriptView Raw
1'use strict';
2
3module.exports = function(grunt) {
4 // Project configuration
5 grunt.initConfig({
6
7 // Linting
8 eslint: {
9 files: [
10 'Gruntfile.js',
11 'tasks/*.js',
12 'test/*.js'
13 ]
14 },
15
16 // Unit tests
17 nodeunit: {
18 files: ['test/*_test.js']
19 },
20
21 // Watcher
22 watch: {
23 files: ['**/*.js'],
24 tasks: ['default']
25 },
26
27 // check pages
28 checkPages: {
29 popular: {
30 options: {
31 pageUrls: grunt.file.readJSON('Gruntfile-pageUrls.json'),
32 checkCaching: true,
33 checkCompression: true,
34 userAgent: 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36',
35 summary: true
36 }
37 }
38 }
39 });
40
41 // Load required plugins
42 grunt.loadNpmTasks('grunt-contrib-nodeunit');
43 grunt.loadNpmTasks('grunt-contrib-watch');
44 grunt.loadNpmTasks('grunt-eslint');
45
46 // Load checkPages plugin for self-testing
47 grunt.loadTasks('./tasks');
48
49 // Default: Test and lint
50 grunt.registerTask('default', ['nodeunit', 'eslint']);
51};