UNPKG

2.18 kBJavaScriptView Raw
1module.exports = function (grunt) {
2
3 // Project configuration.
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: { // Accessibility testing, via ~ http://pa11y.org/
24 test: {
25 options: { // Task-specific options go here.
26 // screenCapture: './_pa11y-screen-capture.png',
27 standard: 'WCAG2AA', // Or 'WCAG2AAA'
28 timeout: 5000,
29 wait: 500,
30 rootElement: 'body', // Was: '#cookieNotice',
31 verifyPage: 'id="cookieNotice"' // Not supported?
32 },
33 url: [ 'http://localhost:8000/tests/data.html' ]
34 //, file: [ 'array of files, globbing permitted' ]
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 // Load the plugins
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 // Default task(s).
65 grunt.registerTask('default', [ 'test', 'strip_code', 'uglify' ]);
66 grunt.registerTask('test', [ 'connect', 'qunit', 'rsids_pa11y' ]);
67
68};