forked from ampproject/amphtml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
210 lines (190 loc) · 5.33 KB
/
config.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/**
* Copyright 2015 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const initTestsPath = ['test/_init_tests.js'];
const fixturesExamplesPaths = [
'test/fixtures/*.html',
{
pattern: 'test/fixtures/served/*.html',
included: false,
nocache: false,
watched: true,
},
{
pattern: 'examples/**/*',
included: false,
nocache: false,
watched: true,
},
];
const builtRuntimePaths = [
{
pattern: 'dist/**/*.js',
included: false,
nocache: false,
watched: true,
},
{
pattern: 'dist.3p/**/*',
included: false,
nocache: false,
watched: true,
},
{
pattern: 'dist.tools/**/*.js',
included: false,
nocache: false,
watched: true,
},
];
const commonUnitTestPaths = initTestsPath.concat(fixturesExamplesPaths);
const commonIntegrationTestPaths = initTestsPath.concat(
fixturesExamplesPaths,
builtRuntimePaths
);
const testPaths = commonIntegrationTestPaths.concat([
'test/*/!(e2e)/**/*.js',
'ads/**/test/test-*.js',
'extensions/**/test/**/*.js',
]);
const a4aTestPaths = initTestsPath.concat([
'extensions/amp-a4a/**/test/**/*.js',
'extensions/amp-ad-network-*/**/test/**/*.js',
'ads/google/a4a/test/*.js',
]);
const chaiAsPromised = ['test/chai-as-promised/chai-as-promised.js'];
const unitTestPaths = [
'test/unit/**/*.js',
'ads/**/test/test-*.js',
'ads/**/test/unit/test-*.js',
'extensions/**/test/*.js',
'extensions/**/test/unit/*.js',
];
const unitTestOnSaucePaths = [
'test/unit/**/*.js',
'ads/**/test/test-*.js',
'ads/**/test/unit/test-*.js',
];
const integrationTestPaths = [
'test/integration/**/*.js',
'extensions/**/test/integration/**/*.js',
];
const e2eTestPaths = ['test/e2e/*.js', 'extensions/**/test-e2e/*.js'];
const devDashboardTestPaths = ['build-system/server/app-index/test/**/*.js'];
const jisonPaths = ['extensions/**/*.jison'];
const lintGlobs = [
'**/*.js',
// To ignore a file / directory, add it to .eslintignore.
];
const presubmitGlobs = [
'**/*.{css,js,go}',
// This does match dist.3p/current, so we run presubmit checks on the
// built 3p binary. This is done, so we make sure our special 3p checks
// run against the entire transitive closure of deps.
'!{node_modules,build,dist,dist.tools,' +
'dist.3p/[0-9]*,dist.3p/current,dist.3p/current-min}/**/*.*',
'!dist.3p/current/**/ampcontext-lib.js',
'!dist.3p/current/**/iframe-transport-client-lib.js',
'!out/**/*.*',
'!validator/validator.pb.go',
'!validator/dist/**/*.*',
'!validator/node_modules/**/*.*',
'!validator/nodejs/node_modules/**/*.*',
'!validator/webui/dist/**/*.*',
'!validator/webui/node_modules/**/*.*',
'!build-system/tasks/e2e/node_modules/**/*.*',
'!build-system/tasks/presubmit-checks.js',
'!build-system/runner/build/**/*.*',
'!build-system/tasks/visual-diff/node_modules/**/*.*',
'!build-system/tasks/visual-diff/snippets/*.js',
'!build/polyfills.js',
'!build/polyfills/*.js',
'!third_party/**/*.*',
'!validator/chromeextension/*.*',
// Files in this testdata dir are machine-generated and are not part
// of the AMP runtime, so shouldn't be checked.
'!extensions/amp-a4a/*/test/testdata/*.js',
'!examples/**/*',
'!examples/visual-tests/**/*',
'!test/coverage/**/*.*',
'!firebase/**/*.*',
];
/**
* List of non-JS files to be checked by `gulp prettify` (using prettier).
* NOTE: When you add a new filename / glob to this list:
* 1. Make sure its formatting options are specified in .prettierrc
* 2. Make sure it is listed in .vscode/settings.json (for auto-fix-on-save)
*/
const prettifyGlobs = [
'.codecov.yml',
'.lando.yml',
'.lgtm.yml',
'.travis.yml',
'**/.eslintrc',
'.prettierrc',
'.renovaterc.json',
'.vscode/settings.json',
'**/*.json',
'**/OWNERS',
'!**/{node_modules,build,dist,dist.3p,dist.tools}/**',
];
/**
* Array of 3p bootstrap urls
* Defined by the following object schema:
* basename: the name of the 3p frame without extension
* max: the path of the readable html
* min: the name of the minimized html
*/
const thirdPartyFrames = [
{
basename: 'frame',
max: '3p/frame.max.html',
min: 'frame.html',
},
{
basename: 'nameframe',
max: '3p/nameframe.max.html',
min: 'nameframe.html',
},
{
basename: 'recaptcha',
max: '3p/recaptcha.max.html',
min: 'recaptcha.html',
},
];
/**
* File types to ignore while auto-generating a changelog for a new release.
*/
const changelogIgnoreFileTypes = /\.md|\.json|\.yaml|LICENSE|CONTRIBUTORS$/;
/** @const */
module.exports = {
a4aTestPaths,
chaiAsPromised,
changelogIgnoreFileTypes,
commonIntegrationTestPaths,
commonUnitTestPaths,
devDashboardTestPaths,
e2eTestPaths,
integrationTestPaths,
jisonPaths,
lintGlobs,
presubmitGlobs,
prettifyGlobs,
testPaths,
thirdPartyFrames,
unitTestOnSaucePaths,
unitTestPaths,
};