forked from micc83/cookie-notice-js
-
Notifications
You must be signed in to change notification settings - Fork 25
/
gruntfile.js
68 lines (63 loc) · 2.13 KB
/
gruntfile.js
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
68
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 8000,
base: '.'
}
}
},
qunit: {
all: {
options: {
urls: [
'http://localhost:8000/tests/index.html'
]
}
}
},
rsids_pa11y: { // Accessibility testing, via ~ http://pa11y.org/
test: {
options: { // Task-specific options go here.
// screenCapture: './_pa11y-screen-capture.png',
standard: 'WCAG2AA', // Or 'WCAG2AAA'
timeout: 5000,
wait: 500,
rootElement: 'body', // Was: '#cookieNotice',
verifyPage: 'id="cookieNotice"' // Not supported?
},
url: [ 'http://localhost:8000/tests/data.html' ]
//, file: [ 'array of files, globbing permitted' ]
}
},
strip_code: {
src: {
src: 'src/cookie.notice.js',
dest: 'dist/cookie.notice.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %> by <%= pkg.author %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
report: 'gzip',
screwIE8: true
},
build: {
src: 'dist/cookie.notice.js',
dest: 'dist/cookie.notice.min.js'
}
}
});
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-strip-code');
grunt.loadNpmTasks('grunt-rsids-pa11y');
// Default task(s).
grunt.registerTask('default', [ 'test', 'strip_code', 'uglify' ]);
grunt.registerTask('test', [ 'connect', 'qunit', 'rsids_pa11y' ]);
};