-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gruntfile.js
111 lines (100 loc) · 3.44 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
'use strict';
/* eslint-env node */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-karma' );
grunt.initConfig( {
eslint: {
options: {
fix: grunt.option( 'fix' ),
cache: true
},
all: '.'
},
banana: {
options: {
requireCompleteMessageDocumentation: false,
disallowUnusedDocumentation: false,
disallowUnusedTranslations: false,
disallowDuplicateTranslations: false,
disallowBlankTranslations: false
},
all: 'i18n/'
},
karma: {
options: {
files: [
'node_modules/jquery/dist/jquery.js',
'node_modules/jquery-ui/ui/jquery.ui.core.js',
'node_modules/jquery-ui/ui/jquery.ui.widget.js',
'node_modules/jquery-ui/ui/jquery.ui.position.js',
'node_modules/jquery-ui/ui/jquery.ui.menu.js',
'node_modules/jquery-migrate/dist/jquery-migrate.js',
'node_modules/sinon/pkg/sinon.js',
'node_modules/wikibase-data-values//lib/util/util.inherit.js',
'lib/jquery/jquery.PurposedCallbacks.js',
'lib/jquery/*.js',
'lib/jquery/*.css',
'lib/jquery.event/*.js',
'lib/jquery.util/*.js',
'lib/util/*.js',
'lib/jquery.ui/jquery.ui.ooMenu.js',
'lib/jquery.ui/jquery.ui.suggester.js',
'lib/jquery.ui/*.js',
'node_modules/wikibase-data-values//lib/globeCoordinate/globeCoordinate.js',
'node_modules/wikibase-data-values//src/dataValues.js',
'node_modules/wikibase-data-values//src/DataValue.js',
'node_modules/wikibase-data-values//src/valueFormatters/valueFormatters.js',
'node_modules/wikibase-data-values//src/valueFormatters/formatters/ValueFormatter.js',
'node_modules/wikibase-data-values//src/valueFormatters/formatters/*.js',
'node_modules/wikibase-data-values//src/valueParsers/valueParsers.js',
'node_modules/wikibase-data-values//src/valueParsers/ValueParserStore.js',
'node_modules/wikibase-data-values//src/valueParsers/parsers/ValueParser.js',
'node_modules/wikibase-data-values//src/valueParsers/parsers/*.js',
'node_modules/wikibase-data-values//src/values/*.js',
'src/jquery.valueview.valueview.js',
'src/*.js',
'src/ExpertExtender/ExpertExtender.js',
'src/ExpertExtender/*.js',
'src/experts/StringValue.js',
'src/experts/*.js',
'tests/sinon-qunit.js',
'tests/lib/jquery/*.js',
'tests/lib/jquery.event/*.js',
'tests/lib/jquery.ui/*.js',
'tests/lib/jquery.util/*.js',
'tests/lib/util/*.js',
'tests/src/jquery.valueview.tests.MockExpert.js',
'tests/src/*.js',
'tests/src/experts/*.js',
'tests/src/ExpertExtender/testExpertExtenderExtension.js',
'tests/src/ExpertExtender/*.js'
],
preprocessors: {
'src/**/*.js': [ 'webpack' ],
'lib/**/*.js': [ 'webpack' ],
'tests/**/*.tests.js': [ 'webpack' ]
},
webpack: { mode: 'development' },
singleRun: true,
logLevel: 'DEBUG',
frameworks: [ 'qunit' ],
customLaunchers: {
ChromeCustom: {
base: 'ChromeHeadless',
// Chrome requires --no-sandbox in Docker/CI.
// Wikimedia CI images expose CHROMIUM_FLAGS which sets that.
flags: ( process.env.CHROMIUM_FLAGS || '' ).split( ' ' )
}
}
},
all: {
browsers: [ 'ChromeCustom', 'FirefoxHeadless' ]
}
}
} );
grunt.registerTask( 'test', [ 'eslint', 'banana', 'qunit' ] );
grunt.registerTask( 'qunit', 'karma' );
grunt.registerTask( 'default', 'test' );
};