forked from SchemaStore/schemastore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchutzpah.json
363 lines (359 loc) · 16.7 KB
/
chutzpah.json
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
{
"title": "JSON schema for Chutzpah test runner settings files",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": true,
"definitions": {
"engineOptions": {
"type": "object",
"description": "The options to configure the chosen browser engine for Chutzpah to use.",
"properties": {
"ChromeBrowserPath": {
"description": "The path to the chrome/chromium executable on the machine",
"type": "string"
}
}
},
"serverSettings": {
"description": "Server settings let you enable to configure Chutzpah web server mode.",
"type": "object",
"properties": {
"Enabled": {
"description": "Determines if the web server mode is enabled.",
"type": "boolean",
"default": false
},
"DefaultPort": {
"description": "The default port to use. If this port is taken Chutzpah will try incrementing until it finds an available one.",
"type": "number"
},
"RootPath": {
"description": "The root path of the server. All file paths are relative to this and should be in a directory below or equal to this. Defaults to drive root.",
"type": "string"
}
}
},
"templateOptions": {
"properties": {
"Mode": {
"description": "The way the template is injected into the HTML page.",
"enum": [ "Raw", "Script" ],
"default": "Raw"
},
"Id": {
"description": "If in script mode what Id to place on the script tag.",
"type": "string"
},
"Type": {
"description": "If in script mode what Type to place on script tag",
"type": "string"
}
}
},
"referenceSettings": {
"properties": {
"Path": {
"description": "The path to either a file or a folder. If given a folder, it will be scanned recursively. This path can be relative to the location of the chutzpah.json file.",
"type": "string"
},
"Includes": {
"description": "This is an optional array of include glob patterns. Only files matching the Include pattern will be added.",
"type": "array",
"items": {
"type": "string"
}
},
"Excludes": {
"description": "This is an optional array of exclude glob patterns. Only files not matching the Exclude patterns will be added.",
"type": "array",
"items": {
"type": "string"
}
},
"IncludeInTestHarness": {
"description": "This determines if the reference should be injected into the test harness. When referencing files like .d.ts or files that you plan to load using require.js you should set this to false. Defaults to true.",
"type": "boolean",
"default": true
},
"IsTestFrameworkFile": {
"description": "Indicated that this references should be placed directly after the test framework files in the test harness. This ensures that this file is injected into the test harness before almost all other files. Defaults to false.",
"type": "boolean",
"default": false
},
"TemplateOptions": {
"$ref": "#/definitions/templateOptions"
}
}
},
"compilePathMap": {
"properties": {
"SourcePath": {
"description": "The source file/directory",
"type": "string"
},
"OutputPath": {
"description": "The file/directory that source file/directory is mapped to. Specifying a file OutputPath and a directory for SourcePath indicated the files are being concatenated into one large file",
"type": "string"
},
"OutputPathType": {
"description": "The type (file or folder) that the output path refers to. If not specified Chutzpah will try to take a best guess by assuming it is a file if it has a .js extension",
"type": "string",
"enum": [ "File", "Folder" ],
"default": "Folder"
}
}
},
"testSettings": {
"properties": {
"Path": {
"description": "The path to either a file or a folder. If given a folder, it will be scanned recursively. This path can be relative to the location of the chutzpah.json file.",
"type": "string"
},
"Includes": {
"description": "This is an optional array of include glob patterns. Only files matching the Include pattern will be added.",
"type": "array",
"items": {
"type": "string"
}
},
"Excludes": {
"description": "This is an optional array of exclude glob patterns. Only files not matching the Exclude patterns will be added.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"transformConfig": {
"properties": {
"Name": {
"description": "The name of the transform to execute",
"type": "string"
},
"Path": {
"description": "The file for the transform to save its output to.",
"type": "string"
}
}
},
"compileSettings": {
"description": "This setting lets you describe in the Chutzpah.json file how to execute a command which can compile your source files to .js files. You tell Chutzpah what to execute and some information about what your executable does (like where to find the generated .js files). Then after running the executable Chutzpah can associate each source file with each output file to still give the nice behavior of mapping tests back to their original files.",
"type": "object",
"properties": {
"Extensions": {
"description": "The extensions of the files which are getting compiled (e.g. .ts).",
"type": "array",
"items": {
"type": "string"
}
},
"ExtensionsWithNoOutput": {
"description": "The extensions of files which take part in compile but have no build output. This is used for cases like TypeScript declaration files which share a .ts extension. They have .d.ts extension and are part of compilation but have no output. You must tell Chutzpah about these if you want the SkipIfUnchanged setting to work. Otherwise Chutzpah will think these are missing output.",
"type": "array",
"items": {
"type": "string"
}
},
"Paths": {
"description": " The collection of path mapping from source directory/file to output directory/file.",
"type": "array",
"items": {
"$ref": "#/definitions/compilePathMap"
}
},
"WorkingDirectory": {
"description": "This is the working directory of the process which executes the command.",
"type": "string"
},
"Executable": {
"description": "The path to an executable which Chutzpah executes to perform the batch compilation. Chutzpah will try to resolve the path relative to the settings directory. But if can’t find the file there you must give it a full path.",
"type": [ "string", "null" ],
"default": null
},
"Arguments": {
"description": "The arguments to pass to the command.",
"type": [ "string", "null" ],
"default": null
},
"Timeout": {
"description": "How long to wait for compile to finish in milliseconds?",
"type": "integer",
"default": 30000
},
"SkipIfUnchanged": {
"description": "Skips the execution if all files Chutzpah knows about are older than all of the output files. This is defaulted to true but if you hit issues since it is possible Chutzpah might not know about all the files your compilation is using then you can turn this off. Ideally you should tell Chutzpah about these files using the references and tests settings since this setting helps Chutzpah not need to even invoke the executable if it figures out it’s not needed.",
"type": "boolean",
"default": true
},
"Mode": {
"description": "Determines how this compile setting is used. By default it is in Executable mode where it will require you provide an executable which Chutzpah will run if it sees it finds missing .js for input file. If you set this to External then Chutzpah will ignore the Executable, Arguments settings and assume you have some external process which is compiling. In this case Chutzpah will use the SourceDirectory and OutDirectory options to try to find your .js files for the input files. If it can't find them it will trace an error but still attempt to proceed.",
"type": "string",
"enum": [ "Executable", "External" ],
"default": "External"
},
"UseSourceMaps": {
"description": "Configures whether .map files should be loaded (if available) to convert under-test JS line numbers to those of their original source files.",
"type": "boolean",
"default": false
},
"IgnoreMissingFiles": {
"description": "Should Chutzpah ignore files it expects to find compiled. If set to true Chutzpah will log an error otherwise it will throw",
"type": "boolean",
"default": false
}
}
}
},
"properties": {
"Framework": {
"description": "Determines what testing framework to use. This will override the other detection methods.",
"type": "string",
"enum": [ "qunit", "jasmine", "mocha" ]
},
"FrameworkVersion": {
"description": "Tells Chutzpah if it should use a different version of on of the test frameworks than the default one. Currently, the only framework this works for is Jasmine. As of the 3.1.0 release Chutzpah default to Jasmine 2.0 but if you want to use the 1.0 line for Jasmine still pass '1' for FrameworkVersion.",
"type": "string"
},
"References": {
"description": "The references setting allows you to specify which files/folders to use/scan to find references. This is useful since it replaces the need to the ///<reference comments.",
"type": "array",
"items": {
"$ref": "#/definitions/referenceSettings"
}
},
"Tests": {
"description": "The references setting allows you to specify which files/folders to use/scan to find references. This is useful since it replaces the need to the ///<reference comments.",
"type": "array",
"items": {
"$ref": "#/definitions/testSettings"
}
},
"Engine": {
"description": "The browser engine to use to run the tests. Default is Phantom but JSDOM and Chrome are available. If you choose Chrome you must have an instance of Chrome or Chromium on the machine that Chutzpah can find.",
"type": "string",
"enum": [ "Phantom", "JSDom", "Chrome" ]
},
"EngineOptions": {
"$ref": "#/definitions/engineOptions"
},
"Server": {
"$ref": "#/definitions/serverSettings"
},
"Transforms": {
"description": "List of transformers to run after testing to generate output files",
"type": "array",
"items": {
"$ref": "#/definitions/transformConfig"
}
},
"Compile": {
"$ref": "#/definitions/compileSettings"
},
"TestFileTimeout": {
"description": "The time to wait for tests in a file to finish in milliseconds.",
"type": "integer"
},
"TestHarnessLocationMode": {
"description": "Determines where to place the generated html test harness files. The default mode is TestFileAdjacent which means the harness is placed in the same directory as the test file. SettingsFileAdjacent means it is placed in the same directory as the chutzpah.json file. Custom mode lets you specify a custom path to the directory.",
"type": "string",
"enum": [ "TestFileAdjacent", "SettingsFileAdjacent", "Custom" ]
},
"TestHarnessReferenceMode": {
"type": "string",
"enum": [ "Normal", "AMD" ]
},
"TestHarnessDirectory": {
"description": "When TestHarnessLocationMode is set to Custom this is either the relative or absolute path to the directory where to place the test harness.",
"type": "string"
},
"RootReferencePathMode": {
"description": "This property determines what directory a rooted reference path refers to.",
"type": "string",
"enum": [ "DriveRoot", "SettingsFileDirectory" ],
"default": "DriveRoot"
},
"CodeCoverageTimeout": {
"description": "The timeout in milliseconds for how long to wait to instrument each file for code coverage. Defaults to 5000ms.",
"type": "integer",
"default": 5000
},
"CodeCoverageExecutionMode": {
"description": "If Always, forces code coverage to run always. If Manual/null/not set, allows code coverage to run if invoked using test adapter, command line or context menu options (default). If Never, forces code coverage to never run.",
"type": "string",
"enum": [ "Manual", "Always", "Never" ]
},
"CodeCoverageSuccessPercentage": {
"description": "The percentage of lines needing to be covered to show the coverage output as success or failure. By default this is 60.",
"type": "number"
},
"CodeCoverageIncludes": {
"description": "The collection code coverage file patterns to include in coverage. These are in glob format. If you specify none all files are included.",
"type": "array",
"items": {
"type": "string"
}
},
"CodeCoverageExcludes": {
"description": "The collection code coverage file patterns to exclude in coverage. These are in glob format. If you specify none no files are excluded.",
"type": "array",
"items": {
"type": "string"
}
},
"CustomTestHarnessPath": {
"description": "The CustomTestHarnessPath setting allows you to override the default template Chutzpah uses for the HTML test harness. This is an advanced feature which should only be used as a last resort.",
"type": "string"
},
"MochaInterface": {
"description": "The name of the Mocha interface to use. Overrides the default detection mechanism.",
"type": "string",
"enum": [ "bdd", "tdd", "qunit" ]
},
"AMDBaseUrl": {
"description": "Set the baseurl for Chutzpah to use when generating the test harness. Defaults to the test harness directory if not set.",
"type": "string"
},
"AMDAppDirectory": {
"description": "Sets the root directory for your AMD paths. This is only needed if your baseUrl is a different location than your source directory. This is common if you are compiling from another language to JavaScript and copying those compiled files to a different folder. For example if you have all your .ts files in /src and you compile them to a /out directory then your AMDBaseUrl is /out and AMDAppDirectory is /src. Defaults to the test harness directory if not set.",
"type": "string"
},
"UserAgent": {
"description": "The user agent to use when making web requests",
"type": "string"
},
"TestPattern": {
"description": "When Chutzpah reports test results it also tells you what line they are on. The way this is accomplished is by having a regex for each testing framework which describes where to find the names of your tests.",
"type": "string",
"format": "regex"
},
"EnableTestFileBatching": {
"description": "Determines if batch all test files for this chutzpah.json file should be batched into one test harness. This will often make your test run much faster.",
"type": "boolean"
},
"InheritFromParent": {
"description": "Determines if this settings file should inherit and merge with the settings of its parent settings file. The parent is found by recursively walking up the tree.",
"type": "boolean"
},
"IgnoreResourceLoadingErrors": {
"description": "Suppress errors that are reported when a script request to load a url (e.g. xhr/script/image) fails.",
"type": "boolean"
},
"EnableTracing": {
"description": "Logs tracing information to a log file.",
"type": "boolean"
},
"TraceFilePath": {
"description": "The path to write the trace file to. Defaults tp %temp%/chutzpah.log.",
"type": "string"
},
"Parallelism": {
"description": "Max degree of parallelism for running tests. Defaults to number of CPUs",
"type": "number"
},
"BrowserArguments": {
"description": "The dictionary of browser name (keys) to corresponding browser arguments (values), i.e.; { 'chrome': '--allow-file-access-from-files' }.",
"type": "object"
}
}
}