UNPKG

26.4 kBJSONView Raw
1{
2 "$schema": "http://json-schema.org/draft-07/schema#",
3 "$id": "https://theintern.io/intern/resources/4/schemas/config-4.8.json",
4
5 "title": "Intern",
6 "description": "Intern v4 config schema",
7
8 "type": "object",
9 "allOf": [
10 { "$ref": "#/definitions/config" },
11 {
12 "type": "object",
13 "properties": {
14 "configs": {
15 "description": "An object of named config objects",
16 "type": "object",
17 "patternProperties": {
18 ".*": { "$ref": "#/definitions/config" }
19 }
20 }
21 }
22 }
23 ],
24
25 "definitions": {
26 "benchmarkOptions": {
27 "type": "object",
28 "properties": {
29 "filename": {
30 "description": "File to write benchmark baseline results to, or to read them from",
31 "type": "string"
32 },
33 "id": {
34 "description": "An optional descriptive ID for the benchark run",
35 "type": "string"
36 },
37 "mode": {
38 "description": "Mode to run benchmark tests in",
39 "type": "string",
40 "enum": ["baseline", "test"]
41 },
42 "thresholds": {
43 "description": "Thresholds to treat as warnings or failures",
44 "type": "object",
45 "properties": {
46 "warn": {
47 "description": "Warning thresholds",
48 "type": "object",
49 "properties": {
50 "rme": {
51 "description": "Relative mean error",
52 "type": "number"
53 },
54 "hz": {
55 "description": "Number of executions per second",
56 "type": "number"
57 },
58 "mean": {
59 "description": "Sample arithmetic mean",
60 "type": "number"
61 }
62 }
63 },
64 "fail": {
65 "description": "Error thresholds",
66 "type": "object",
67 "properties": {
68 "rme": {
69 "description": "Relative mean error",
70 "type": "number"
71 },
72 "hz": {
73 "description": "Number of executions per second",
74 "type": "number"
75 },
76 "mean": {
77 "description": "Sample arithmetic mean",
78 "type": "number"
79 }
80 }
81 }
82 }
83 }
84 }
85 },
86
87 "browserStackOptions": {
88 "type": "object",
89 "properties": {
90 "automateOnly": { "const": true },
91 "environmentUrl": { "type": "string" },
92 "forceLocal": { "type": "boolean" },
93 "killOtherTunnels": { "type": "boolean" },
94 "servers": { "type": "array", "items": { "type": "string" } },
95 "skipServerValidation": { "type": "boolean" }
96 }
97 },
98
99 "browserVersion": {
100 "description": "A browser version, a list of browser versions, or a version range",
101 "oneOf": [
102 {
103 "type": "array",
104 "items": {
105 "anyOf": [
106 { "type": "string" },
107 { "$ref": "#/definitions/positiveNumber" }
108 ]
109 }
110 },
111 { "type": "string" },
112 { "$ref": "#/definitions/positiveNumber" }
113 ],
114 "examples": [
115 "1",
116 "latest",
117 "latest-1",
118 "1..3",
119 "1..latest",
120 ["1", "2", "3"],
121 ["1", "2", "latest"]
122 ]
123 },
124
125 "capabilities": {
126 "description": "WebDriver capabilities that will apply to all WebDriver environments",
127 "type": "object",
128 "properties": {
129 "name": {
130 "description": "A name for the session",
131 "type": "string"
132 },
133 "build": {
134 "description": "A build identifier used by some services",
135 "type": "string"
136 }
137 }
138 },
139
140 "config": {
141 "type": "object",
142 "properties": {
143 "$schema": {
144 "type": "string"
145 },
146
147 "bail": {
148 "description": "If true, Intern will stop running tests after the first failure.",
149 "type": "boolean",
150 "default": true
151 },
152
153 "baseline": {
154 "description": "If true, benchmark tests will run in baseline mode.",
155 "type": "boolean",
156 "default": true
157 },
158
159 "basePath": {
160 "description": "The path to the project root. This will be resolved to an absolute path before testing starts.",
161 "type": "string",
162 "examples": ["node_modules/intern"]
163 },
164
165 "benchmark": {
166 "description": "Benchmark tests will only run when this property is true",
167 "type": "boolean",
168 "default": true
169 },
170
171 "benchmarkConfig": {
172 "description": "Options for benchmark tests",
173 "$ref": "#/definitions/benchmarkOptions"
174 },
175
176 "browser": {
177 "description": "Resources that will only be loaded/used in browsers",
178 "type": "object",
179 "properties": {
180 "loader": { "$ref": "#/definitions/loaderProperty" },
181 "plugins": { "$ref": "#/definitions/pluginsProperty" },
182 "plugins+": { "$ref": "#/definitions/pluginsProperty+" },
183 "reporters": { "$ref": "#/definitions/reportersProperty" },
184 "reporters+": { "$ref": "#/definitions/reportersProperty+" },
185 "suites": { "$ref": "#/definitions/suitesProperty" },
186 "suites+": { "$ref": "#/definitions/suitesProperty+" }
187 }
188 },
189
190 "capabilities": { "$ref": "#/definitions/capabilities" },
191 "capabilities+": {
192 "description": "Additional capabilities",
193 "$ref": "#/definitions/capabilities"
194 },
195
196 "connectTimeout": {
197 "description": "Time, in milliseconds, to wait for contact from a remote server",
198 "$ref": "#/definitions/positiveNumber",
199 "examples": [30000]
200 },
201
202 "coverage": {
203 "description": "An array of file paths or globs that should be instrumented for code coverage, or false to completely disable coverage. Globs starting with ! are exclusions.",
204 "oneOf": [
205 { "const": false },
206 { "type": "array", "items": { "type": "string" } },
207 { "type": "string" }
208 ],
209 "examples": [
210 false,
211 "_build/**/*.js",
212 ["_build/**/*.js", "!_build/src/browser.js"]
213 ]
214 },
215
216 "coverageVariable": {
217 "description": "The global variable that will be used to store coverage data",
218 "type": "string",
219 "examples": ["__coverage__"]
220 },
221
222 "debug": {
223 "description": "If true, intern will emit internal log events",
224 "type": "boolean",
225 "default": true
226 },
227
228 "defaultTimeout": {
229 "description": "The number of milliseconds that Intern will wait for an asynchronous test to complete before timing out",
230 "$ref": "#/definitions/positiveNumber",
231 "examples": [30000]
232 },
233
234 "description": {
235 "description": "A description for this test run",
236 "type": "string"
237 },
238
239 "environments": { "$ref": "#/definitions/environments" },
240 "environments+": {
241 "description": "Additional environments",
242 "$ref": "#/definitions/environments"
243 },
244
245 "filterErrorStack": {
246 "description": "If true, filter external library calls and runtime calls out of error stacks.",
247 "type": "boolean"
248 },
249
250 "functionalBaseUrl": {
251 "description": "The base URL to use for relative addresses in functional tests",
252 "type": "string"
253 },
254
255 "functionalCoverage": {
256 "description": "If true, collect coverage data from functional tests.",
257 "type": "boolean"
258 },
259
260 "functionalSuites": {
261 "description": "Suites to run as functional (WebDriver) tests",
262 "$ref": "#/definitions/suitesProperty"
263 },
264 "functionalSuites+": {
265 "description": "Additional functional suites",
266 "$ref": "#/definitions/suitesProperty"
267 },
268
269 "functionalTimeouts": {
270 "description": "Default timeout values for functional tests",
271 "type": "object",
272 "properties": {
273 "find": {
274 "description": "Timeout for find() or findAll() calls",
275 "$ref": "#/definitions/positiveNumber"
276 },
277 "executeAsync": {
278 "description": "Timeout for executeAsync() calls",
279 "$ref": "#/definitions/positiveNumber"
280 },
281 "pageLoad": {
282 "description": "Time to wait for get() calls",
283 "$ref": "#/definitions/positiveNumber"
284 }
285 }
286 },
287
288 "grep": {
289 "description": "A regular expression that is used to filter which tests are run based on test IDs",
290 "type": "string"
291 },
292
293 "heartbeatInterval": {
294 "description": "How often to send a heartbeat to a remote browser, in seconds",
295 "$ref": "#/definitions/positiveNumber"
296 },
297
298 "instrumenterOptions": { "$ref": "#/definitions/instrumenterOptions" },
299 "instrumenterOptions+": {
300 "description": "Additional instrumenter options",
301 "$ref": "#/definitions/instrumenterOptions"
302 },
303
304 "internPath": {
305 "type": "string",
306 "description": "The path to Intern"
307 },
308
309 "leaveRemoteOpen": {
310 "description": "Leave the remote browser open after testing is finished. If true, always leave the remote open. If 'fail', only leave open for test failures.",
311 "oneOf": [{ "type": "boolean" }, { "const": "fail" }]
312 },
313
314 "loader": { "$ref": "#/definitions/loaderProperty" },
315
316 "maxConcurrency": {
317 "description": "The number of concurrent remote test sessions to run at once",
318 "type": "integer",
319 "minimum": 1
320 },
321
322 "name": {
323 "description": "A top-level name for this configuration",
324 "type": "string"
325 },
326
327 "node": {
328 "description": "Resources that will only be loaded/used in Node",
329 "type": "object",
330 "properties": {
331 "loader": { "$ref": "#/definitions/loaderProperty" },
332 "plugins": { "$ref": "#/definitions/pluginsProperty" },
333 "plugins+": { "$ref": "#/definitions/pluginsProperty+" },
334 "reporters": { "$ref": "#/definitions/reportersProperty" },
335 "reporters+": { "$ref": "#/definitions/reportersProperty+" },
336 "suites": { "$ref": "#/definitions/suitesProperty" },
337 "suites+": { "$ref": "#/definitions/suitesProperty+" },
338 "tsconfig": {
339 "oneOf": [{ "type": "string" }, { "const": false }]
340 }
341 },
342 "additionalProperties": false
343 },
344
345 "plugins": { "$ref": "#/definitions/pluginsProperty" },
346 "plugins+": { "$ref": "#/definitions/pluginsProperty+" },
347
348 "proxy": {
349 "description": "A proxy that should be used for outgoing web connections",
350 "type": "string",
351 "examples": [
352 "http://localhost:8888",
353 "http://bob:abc123@localhost:8888"
354 ]
355 },
356
357 "remoteOptions": { "$ref": "#/definitions/remoteOptions" },
358
359 "reporters": { "$ref": "#/definitions/reportersProperty" },
360 "reporters+": { "$ref": "#/definitions/reportersProperty+" },
361
362 "runInSync": {
363 "description": "If true, a remote will wait for responses from Intern for any executor events.",
364 "type": "boolean"
365 },
366
367 "serveOnly": {
368 "description": "If true, start Intern's static test server but do not run any tests",
369 "type": "boolean"
370 },
371
372 "serverPort": {
373 "description": "The port Intern's static server will listen on during testing",
374 "type": "integer",
375 "minimum": 1025,
376 "examples": [9000]
377 },
378
379 "serverUrl": {
380 "description": "The URL a remote should use to access Intern's static server",
381 "type": "string",
382 "examples": ["http://localhost:9000"]
383 },
384
385 "sessionId": {
386 "description": "An identifier for this test session",
387 "type": "string"
388 },
389
390 "showConfig": {
391 "description": "If true, display the resolved config and exit",
392 "type": "boolean"
393 },
394
395 "socketPort": {
396 "description": "The port Intern's websocket server will listen on during testing",
397 "type": "integer",
398 "minimum": 1025,
399 "examples": [9001]
400 },
401
402 "socketTimeout": {
403 "description": "The number of milliseconds to wait before a websocket message is considered to be timed out",
404 "type": "integer",
405 "examples": [10000]
406 },
407
408 "suites": { "$ref": "#/definitions/suitesProperty" },
409 "suites+": { "$ref": "#/definitions/suitesProperty+" },
410
411 "tunnel": {
412 "description": "The Dig Dug tunnel class to use for WebDriver testing",
413 "type": "string",
414 "enum": [
415 "null",
416 "selenium",
417 "browserstack",
418 "cbt",
419 "saucelabs",
420 "testingbot"
421 ]
422 },
423
424 "tunnelOptions": { "$ref": "#/definitions/tunnelOptions" },
425 "tunnelOptions+": {
426 "description": "Additional tunnel options",
427 "$ref": "#/definitions/tunnelOptions"
428 },
429
430 "warnOnUncaughtException": {
431 "description": "If true or set to a RegExp that matches the reason for an uncaught exception, Intern will treat the exception as a warning.",
432 "oneOf": [{ "type": "boolean" }, { "type": "string" }]
433 },
434
435 "warnOnUnhandledRejection": {
436 "description": "If true or set to a RegExp that matches the reason for an unhandled rejection, Intern will treat the rejection as a warning.",
437 "oneOf": [{ "type": "boolean" }, { "type": "string" }]
438 }
439 }
440 },
441
442 "coverageReporterOptions": {
443 "type": "object",
444 "properties": {
445 "filename": { "type": "string" },
446 "directory": { "type": "string" },
447 "watermarks": {
448 "typee": "object",
449 "properties": {
450 "statements": { "type": "array", "items": { "type": "number" } },
451 "functions": { "type": "array", "items": { "type": "number" } },
452 "branches": { "type": "array", "items": { "type": "number" } },
453 "lines": { "type": "array", "items": { "type": "number" } }
454 }
455 }
456 }
457 },
458
459 "environments": {
460 "description": "The environments (node or particular browsers) to run tests in",
461 "oneOf": [
462 {
463 "description": "A browser name or 'node'",
464 "type": "string",
465 "examples": ["node", "chrome"]
466 },
467 {
468 "description": "An environment specifier",
469 "$ref": "#/definitions/environmentSpec"
470 },
471 {
472 "description": "A list of browser names and/or environment specifiers",
473 "type": "array",
474 "items": {
475 "anyOf": [
476 {
477 "type": "string",
478 "description": "A browser name or 'node' for Node.js"
479 },
480 { "$ref": "#/definitions/environmentSpec" }
481 ]
482 },
483 "examples": [
484 ["chrome", { "browserName": "firefox", "version": "65" }]
485 ]
486 }
487 ]
488 },
489
490 "environmentSpec": {
491 "type": "object",
492 "properties": {
493 "browser": { "type": "string" },
494 "browserName": { "type": "string" },
495 "browserVersion": { "$ref": "#/definitions/browserVersion" },
496 "version": { "$ref": "#/definitions/browserVersion" },
497 "fixSessionCapabilities": {
498 "oneOf": [{ "const": "no-detect" }, { "type": "boolean" }]
499 }
500 },
501 "examples": [
502 { "browserName": "chrome" },
503 { "browserName": "chrome", "browerVersion": "74" },
504 { "browserName": "chrome", "fixSessionCapabilities": false }
505 ]
506 },
507
508 "genericTunnelOptions": {
509 "type": "object",
510 "properties": {
511 "architecture": { "type": "string" },
512 "auth": { "type": "string" },
513 "accessKey": { "type": "string" },
514 "executable": { "type": "string" },
515 "hostname": { "type": "string" },
516 "pathname": { "type": "string" },
517 "platform": { "type": "string" },
518 "port": { "type": "string" },
519 "protocol": { "type": "string" },
520 "tunnelId": { "type": "string" },
521 "username": { "type": "string" },
522 "verbose": { "type": "boolean" }
523 }
524 },
525
526 "instrumenterOptions": {
527 "description": "An object containing options for the Istanbul instrumenter",
528 "type": "object"
529 },
530
531 "loaderProperty": {
532 "description": "A module loader used to load test suites and application modules",
533 "oneOf": [
534 { "$ref": "#/definitions/loaderName" },
535 {
536 "description": "A loader specifier",
537 "type": "object",
538 "properties": {
539 "script": { "$ref": "#/definitions/loaderName" },
540 "options": {
541 "type": "object",
542 "properties": {
543 "internLoaderPath": { "type": "string" }
544 }
545 }
546 },
547 "required": ["script"],
548 "examples": [
549 {
550 "script": "dojo",
551 "options": {
552 "packages": [
553 { "name": "dojo", "location": "node_modules/dojo/dojo.js" }
554 ]
555 }
556 }
557 ]
558 }
559 ]
560 },
561
562 "loaderName": {
563 "description": "The name of a built-in loader",
564 "type": "string",
565 "enum": ["dojo", "dojo2", "esm", "systemjs"]
566 },
567
568 "pluginSpec": {
569 "type": "object",
570 "properties": {
571 "script": { "type": "string" },
572 "useLoader": { "type": "boolean" },
573 "options": { "type": "object" }
574 },
575 "required": ["script"],
576 "examples": [{ "script": "src/helpers.js", "useLoader": true }]
577 },
578
579 "pluginsProperty": {
580 "description": "Scripts or modules to load before suites are loaded",
581 "oneOf": [
582 {
583 "description": "An import path for a script",
584 "type": "string",
585 "examples": ["ts-node/register"]
586 },
587 { "$ref": "#/definitions/pluginSpec" },
588 {
589 "type": "array",
590 "items": {
591 "anyOf": [
592 { "type": "string" },
593 { "$ref": "#/definitions/pluginSpec" }
594 ]
595 },
596 "examples": [
597 [
598 "ts-node/register",
599 { "script": "src/helpers.js", "useLoader": true }
600 ]
601 ]
602 }
603 ]
604 },
605
606 "pluginsProperty+": {
607 "description": "Additional plugins",
608 "#ref": "#/definitions/pluginsProperty"
609 },
610
611 "positiveNumber": {
612 "type": "number",
613 "minimum": 0
614 },
615
616 "remoteOptions": {
617 "description": "Options to pass to the remote runner",
618 "type": "object",
619 "properties": {
620 "disableDomUpdates": { "type": "boolean" }
621 }
622 },
623
624 "reporterName": {
625 "description": "The name of a built-in reporter",
626 "type": "string",
627 "enum": [
628 "benchmark",
629 "cobertura",
630 "console",
631 "dom",
632 "html",
633 "htmlcoverage",
634 "jsoncoverage",
635 "junit",
636 "lcov",
637 "pretty",
638 "runner",
639 "simple",
640 "teamcity"
641 ]
642 },
643
644 "reporterSpec": {
645 "type": "object",
646 "properties": {
647 "name": { "$ref": "#/definitions/reporterName" }
648 },
649 "allOf": [
650 {
651 "if": {
652 "properties": {
653 "name": { "const": "benchmark" }
654 }
655 },
656 "then": {
657 "properties": {
658 "options": {
659 "$ref": "#/definitions/benchmarkOptions"
660 }
661 }
662 }
663 },
664 {
665 "if": {
666 "properties": {
667 "name": { "const": "cobertura" }
668 }
669 },
670 "then": {
671 "properties": {
672 "options": {
673 "allOf": [
674 {
675 "type": "object",
676 "properties": {
677 "projectRoot": { "type": "string" }
678 }
679 },
680 { "$ref": "#/definitions/coverageReporterOptions" }
681 ]
682 }
683 }
684 }
685 },
686 {
687 "if": {
688 "properties": {
689 "name": { "const": "htmlcoverage" }
690 }
691 },
692 "then": {
693 "properties": {
694 "options": {
695 "allOf": [
696 {
697 "type": "object",
698 "properties": {
699 "verbose": { "type": "boolean" }
700 }
701 },
702 { "$ref": "#/definitions/coverageReporterOptions" }
703 ]
704 }
705 }
706 }
707 },
708 {
709 "if": {
710 "properties": {
711 "name": { "const": "jsoncoverage" }
712 }
713 },
714 "then": {
715 "properties": {
716 "options": { "$ref": "#/definitions/coverageReporterOptions" }
717 }
718 }
719 },
720 {
721 "if": {
722 "properties": {
723 "name": { "const": "junit" }
724 }
725 },
726 "then": {
727 "properties": {
728 "options": {
729 "type": "object",
730 "properties": {
731 "filename": { "type": "string" }
732 }
733 }
734 }
735 }
736 },
737 {
738 "if": {
739 "properties": {
740 "name": { "const": "lcov" }
741 }
742 },
743 "then": {
744 "properties": {
745 "options": { "$ref": "#/definitions/coverageReporterOptions" }
746 }
747 }
748 },
749 {
750 "if": {
751 "properties": {
752 "name": { "const": "pretty" }
753 }
754 },
755 "then": {
756 "properties": {
757 "options": {
758 "type": "object",
759 "properties": {
760 "dimensions": {},
761 "titleWidth": { "$ref": "#/definitions/positiveNumber" },
762 "maxProgressBarWidth": {
763 "$ref": "#/definitions/positiveNumber"
764 },
765 "colorReplacement": {
766 "type": "object",
767 "properties": {
768 "0": { "type": "string" },
769 "1": { "type": "string" },
770 "2": { "type": "string" },
771 "✓": { "type": "string" },
772 "!": { "type": "string" },
773 "×": { "type": "string" },
774 "~": { "type": "string" },
775 "⚠": { "type": "string" }
776 }
777 }
778 }
779 }
780 }
781 }
782 },
783 {
784 "if": {
785 "properties": {
786 "name": { "const": "runner" }
787 }
788 },
789 "then": {
790 "properties": {
791 "options": {
792 "type": "object",
793 "properties": {
794 "hidePassed": { "type": "boolean" },
795 "hideSkipped": { "type": "boolean" },
796 "hideTunnelDownloadProgress": { "type": "boolean" }
797 }
798 }
799 }
800 }
801 },
802 {
803 "if": {
804 "properties": {
805 "name": { "const": "textcoverage" }
806 }
807 },
808 "then": {
809 "properties": {
810 "options": {
811 "allOf": [
812 {
813 "type": "object",
814 "properties": {
815 "maxColumns": { "$ref": "#/definitions/positiveNumber" }
816 }
817 },
818 { "$ref": "#/definitions/coverageReporterOptions" }
819 ]
820 }
821 }
822 }
823 }
824 ]
825 },
826
827 "reportersProperty": {
828 "description": "A list of reporter names or descriptors",
829 "oneOf": [
830 { "$ref": "#/definitions/reporterName" },
831 { "$ref": "#/definitions/reporterSpec" },
832 {
833 "type": "array",
834 "items": {
835 "anyOf": [
836 { "$ref": "#/definitions/reporterName" },
837 { "$ref": "#/definitions/reporterSpec" }
838 ]
839 }
840 }
841 ]
842 },
843
844 "reportersProperty+": {
845 "description": "Additional reporters",
846 "$ref": "#/definitions/reportersProperty"
847 },
848
849 "seleniumOptions": {
850 "type": "object",
851 "properties": {
852 "baseUrl": { "type": "string" },
853 "drivers": {},
854 "seleniumArgs": { "type": "array", "items": { "type": "string" } },
855 "seleniumTimeout": { "$ref": "#/definitions/positiveNumber" },
856 "version": { "type": "string" }
857 }
858 },
859
860 "suitesProperty": {
861 "description": "A list of paths or glob expressions that point to suite scripts",
862 "oneOf": [
863 { "description": "A suite path or glob", "type": "string" },
864 {
865 "description": "An array of suite paths or globs",
866 "type": "array",
867 "items": { "type": "string" }
868 }
869 ]
870 },
871
872 "suitesProperty+": {
873 "description": "Additional suites",
874 "$ref": "#/definitions/suitesProperty"
875 },
876
877 "tunnelOptions": {
878 "description": "Options for the current selected tunnel",
879 "anyOf": [
880 { "$ref": "#/definitions/genericTunnelOptions" },
881 { "$ref": "#/definitions/browserStackOptions" },
882 { "$ref": "#/definitions/seleniumOptions" }
883 ]
884 }
885 }
886}