1 | module.exports = function (grunt) {
|
2 |
|
3 |
|
4 | grunt.initConfig({
|
5 | pkg: grunt.file.readJSON('package.json'),
|
6 | connect: {
|
7 | server: {
|
8 | options: {
|
9 | port: 8000,
|
10 | base: '.'
|
11 | }
|
12 | }
|
13 | },
|
14 | qunit: {
|
15 | all: {
|
16 | options: {
|
17 | urls: [
|
18 | 'http://localhost:8000/tests/index.html'
|
19 | ]
|
20 | }
|
21 | }
|
22 | },
|
23 | rsids_pa11y: {
|
24 | test: {
|
25 | options: {
|
26 |
|
27 | standard: 'WCAG2AA',
|
28 | timeout: 5000,
|
29 | wait: 500,
|
30 | rootElement: 'body',
|
31 | verifyPage: 'id="cookieNotice"'
|
32 | },
|
33 | url: [ 'http://localhost:8000/tests/data.html' ]
|
34 |
|
35 | }
|
36 | },
|
37 | strip_code: {
|
38 |
|
39 | src: {
|
40 | src: 'src/cookie.notice.js',
|
41 | dest: 'dist/cookie.notice.js'
|
42 | }
|
43 | },
|
44 | uglify: {
|
45 | options: {
|
46 | banner: '/*! <%= pkg.name %> v<%= pkg.version %> by <%= pkg.author %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
|
47 | report: 'gzip',
|
48 | screwIE8: true
|
49 | },
|
50 | build: {
|
51 | src: 'dist/cookie.notice.js',
|
52 | dest: 'dist/cookie.notice.min.js'
|
53 | }
|
54 | }
|
55 | });
|
56 |
|
57 |
|
58 | grunt.loadNpmTasks('grunt-contrib-uglify');
|
59 | grunt.loadNpmTasks('grunt-contrib-connect');
|
60 | grunt.loadNpmTasks('grunt-contrib-qunit');
|
61 | grunt.loadNpmTasks('grunt-strip-code');
|
62 | grunt.loadNpmTasks('grunt-rsids-pa11y');
|
63 |
|
64 |
|
65 | grunt.registerTask('default', [ 'test', 'strip_code', 'uglify' ]);
|
66 | grunt.registerTask('test', [ 'connect', 'qunit', 'rsids_pa11y' ]);
|
67 |
|
68 | };
|