@camperaid/watest 2.4.7 → 2.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/.prettierrc.js +1 -3
  2. package/.watestrc.js +1 -3
  3. package/bin/watest.js +3 -8
  4. package/core/base.js +60 -59
  5. package/core/core.js +25 -46
  6. package/core/format.js +96 -56
  7. package/core/process_args.js +1 -5
  8. package/core/series.js +60 -56
  9. package/core/settings.js +27 -32
  10. package/core/spawn.js +14 -21
  11. package/core/util.js +12 -19
  12. package/eslint.config.js +27 -0
  13. package/index.js +11 -17
  14. package/interfaces/logger.js +1 -3
  15. package/interfaces/servicer.js +1 -3
  16. package/logging/filestream.js +3 -7
  17. package/logging/logging.js +5 -11
  18. package/logging/logpipe.js +21 -21
  19. package/package.json +12 -11
  20. package/tests/base/t_api.js +3 -6
  21. package/tests/base/t_contains.js +12 -12
  22. package/tests/base/t_core.js +11 -8
  23. package/tests/base/t_format.js +13 -14
  24. package/tests/base/t_is.js +9 -11
  25. package/tests/base/t_is_object.js +23 -25
  26. package/tests/base/t_is_primitive.js +12 -14
  27. package/tests/base/t_is_string.js +6 -8
  28. package/tests/base/t_ok.js +4 -6
  29. package/tests/base/t_stringify.js +6 -8
  30. package/tests/base/t_test_.js +3 -5
  31. package/tests/base/t_throws.js +10 -12
  32. package/tests/base/test.js +8 -18
  33. package/tests/e2e/samples/{loader/.watestrc.cjs → folder/.watestrc.js} +1 -1
  34. package/tests/e2e/samples/folder/package-lock.json +1019 -5940
  35. package/tests/e2e/samples/folder/package.json +3 -2
  36. package/tests/e2e/samples/folder/tests/meta.js +1 -1
  37. package/tests/e2e/samples/folder/tests/unit/t_test.js +3 -3
  38. package/tests/e2e/samples/{loader_mixed/.watestrc.cjs → loader/.watestrc.js} +1 -1
  39. package/tests/e2e/samples/loader/package-lock.json +1751 -28
  40. package/tests/e2e/samples/loader/package.json +2 -2
  41. package/tests/e2e/samples/{folder/.watestrc.cjs → loader_mixed/.watestrc.js} +1 -1
  42. package/tests/e2e/samples/loader_mixed/package-lock.json +1751 -28
  43. package/tests/e2e/samples/loader_multiple/{.watestrc.cjs → .watestrc.js} +1 -1
  44. package/tests/e2e/samples/loader_multiple/package-lock.json +1751 -28
  45. package/tests/e2e/samples/loader_multiple/package.json +2 -2
  46. package/tests/e2e/samples/single/.watestrc.js +5 -0
  47. package/tests/e2e/samples/single/package-lock.json +1017 -5938
  48. package/tests/e2e/samples/single/package.json +5 -2
  49. package/tests/e2e/samples/wd_mixed/{.watestrc.cjs → .watestrc.js} +1 -1
  50. package/tests/e2e/samples/wd_mixed/package-lock.json +779 -4862
  51. package/tests/e2e/samples/wd_mixed/package.json +2 -2
  52. package/tests/e2e/samples/wd_single/{.watestrc.cjs → .watestrc.js} +1 -1
  53. package/tests/e2e/samples/wd_single/package-lock.json +779 -4862
  54. package/tests/e2e/samples/wd_single/package.json +2 -2
  55. package/tests/e2e/t_folder.js +4 -6
  56. package/tests/e2e/t_loader.js +4 -6
  57. package/tests/e2e/t_loader_mixed.js +4 -6
  58. package/tests/e2e/t_loader_multiple.js +4 -6
  59. package/tests/e2e/t_loader_multiple_patterns.js +4 -6
  60. package/tests/e2e/t_single.js +4 -6
  61. package/tests/e2e/t_wd_firefox.js +4 -6
  62. package/tests/e2e/t_wd_firefox_chrome.js +4 -6
  63. package/tests/e2e/t_wd_firefox_chrome_pattern.js +4 -6
  64. package/tests/e2e/t_wd_mixed_firefox.js +4 -6
  65. package/tests/e2e/t_wd_mixed_firefox_chrome.js +4 -6
  66. package/tests/e2e/test.js +15 -16
  67. package/tests/meta.js +1 -3
  68. package/tests/series/build/t_adjust_names.js +4 -6
  69. package/tests/series/build/t_adjust_names_webdriver.js +6 -10
  70. package/tests/series/build/t_expected_failures.js +4 -6
  71. package/tests/series/build/t_loader.js +4 -6
  72. package/tests/series/build/t_loader_mixed.js +4 -6
  73. package/tests/series/build/t_mixed.js +4 -6
  74. package/tests/series/build/t_nested.js +4 -6
  75. package/tests/series/build/t_patterns_loader.js +4 -6
  76. package/tests/series/build/t_patterns_webdriver.js +4 -6
  77. package/tests/series/build/t_webdriver.js +4 -6
  78. package/tests/series/build/t_webdriver_firefox_mixed.js +4 -6
  79. package/tests/series/build/t_webdriver_nested.js +4 -6
  80. package/tests/series/build/t_webdriver_services.js +4 -6
  81. package/tests/series/generic/t_failures_info.js +9 -12
  82. package/tests/series/logging/t_failures.js +18 -20
  83. package/tests/series/logging/t_success.js +15 -17
  84. package/tests/series/logging/t_verify.js +17 -14
  85. package/tests/series/meta.js +1 -3
  86. package/tests/series/mock_series.js +7 -13
  87. package/tests/series/perform/t_failure.js +4 -6
  88. package/tests/series/perform/t_failure_notest.js +4 -6
  89. package/tests/series/perform/t_intermittent.js +5 -7
  90. package/tests/series/perform/t_intermittent_global.js +4 -6
  91. package/tests/series/perform/t_missing_perma.js +5 -7
  92. package/tests/series/perform/t_nested.js +4 -10
  93. package/tests/series/perform/t_perma.js +4 -6
  94. package/tests/series/perform/t_success.js +5 -11
  95. package/tests/series/run/t_debunk_failure.js +7 -6
  96. package/tests/series/run/t_debunk_success.js +7 -6
  97. package/tests/series/run/t_nested.js +7 -6
  98. package/tests/series/run/t_verify.js +7 -6
  99. package/tests/series/run/t_verify_webdriver.js +7 -6
  100. package/tests/series/test.js +29 -40
  101. package/tests/webdriver/meta.js +1 -3
  102. package/tests/webdriver/t_app_driver.js +3 -5
  103. package/tests/webdriver/t_app_driver_selectors.js +3 -5
  104. package/tests/webdriver/t_attribute.js +5 -7
  105. package/tests/webdriver/t_attribute_all.js +6 -8
  106. package/tests/webdriver/t_doubleclick.js +3 -5
  107. package/tests/webdriver/t_doubleclickat.js +3 -5
  108. package/tests/webdriver/t_execute.js +4 -6
  109. package/tests/webdriver/t_if_has_elements.js +6 -8
  110. package/tests/webdriver/t_if_no_elements.js +6 -8
  111. package/tests/webdriver/t_no_elements_or_not_visible.js +7 -9
  112. package/tests/webdriver/t_properties.js +11 -13
  113. package/tests/webdriver/t_script.js +8 -10
  114. package/tests/webdriver/t_select_all.js +6 -11
  115. package/tests/webdriver/t_selection.js +4 -6
  116. package/tests/webdriver/t_text.js +12 -14
  117. package/tests/webdriver/t_text_all.js +6 -8
  118. package/tests/webdriver/test.js +32 -41
  119. package/webdriver/app_driver.js +15 -19
  120. package/webdriver/control_driver.js +4 -8
  121. package/webdriver/driver.js +58 -61
  122. package/webdriver/driver_base.js +50 -60
  123. package/webdriver/session.js +6 -11
  124. package/webdriver/util.js +7 -8
  125. package/.eslintrc.js +0 -45
  126. package/index.mjs +0 -5
  127. package/tests/e2e/samples/folder/node_modules/.package-lock.json +0 -3871
  128. package/tests/e2e/samples/loader/node_modules/.package-lock.json +0 -36
  129. package/tests/e2e/samples/loader_mixed/node_modules/.package-lock.json +0 -36
  130. package/tests/e2e/samples/loader_multiple/node_modules/.package-lock.json +0 -36
  131. package/tests/e2e/samples/single/.watestrc.cjs +0 -5
  132. package/tests/e2e/samples/single/node_modules/.package-lock.json +0 -3871
  133. package/tests/e2e/samples/wd_mixed/node_modules/.package-lock.json +0 -3586
  134. package/tests/e2e/samples/wd_single/node_modules/.package-lock.json +0 -3586
@@ -1,8 +1,6 @@
1
- 'use strict';
1
+ import { is_output, is_primitive } from './test.js';
2
2
 
3
- const { is_output, is_primitive } = require('./test.js');
4
-
5
- module.exports.test = async () => {
3
+ export async function test() {
6
4
  is_primitive(3, 3, `Equal`);
7
5
 
8
6
  // number sucess
@@ -10,7 +8,7 @@ module.exports.test = async () => {
10
8
  () => is_primitive(3, 3, `Equal`),
11
9
  [`Ok: Equal, got: 3`],
12
10
  [],
13
- `number sucess`
11
+ `number sucess`,
14
12
  );
15
13
 
16
14
  // number failure
@@ -18,7 +16,7 @@ module.exports.test = async () => {
18
16
  () => is_primitive(3, 4, `Not equal`),
19
17
  [],
20
18
  [`Failed: Not equal, got: 3, expected: 4`],
21
- `number failure`
19
+ `number failure`,
22
20
  );
23
21
 
24
22
  // string sucess
@@ -26,7 +24,7 @@ module.exports.test = async () => {
26
24
  () => is_primitive('3', '3', `Equal`),
27
25
  [`Ok: Equal, got: 3`],
28
26
  [],
29
- `string sucess`
27
+ `string sucess`,
30
28
  );
31
29
 
32
30
  // string failure
@@ -42,7 +40,7 @@ expected:
42
40
  unexpected character: '3' at 0 pos, expected: '4' at '' line
43
41
  `,
44
42
  ],
45
- `string failure`
43
+ `string failure`,
46
44
  );
47
45
 
48
46
  // regexp sucess
@@ -50,7 +48,7 @@ unexpected character: '3' at 0 pos, expected: '4' at '' line
50
48
  () => is_primitive('34', /^\d+$/, `Equal`),
51
49
  [`Ok: Equal '34' matches /^\\d+$/ regexp`],
52
50
  [],
53
- `regexp sucess`
51
+ `regexp sucess`,
54
52
  );
55
53
 
56
54
  // regexp failure
@@ -58,7 +56,7 @@ unexpected character: '3' at 0 pos, expected: '4' at '' line
58
56
  () => is_primitive('34a', /^\d+$/, `Equal`),
59
57
  [],
60
58
  [`Failed: Equal '34a' doesn't match /^\\d+$/ regexp`],
61
- `regexp failure`
59
+ `regexp failure`,
62
60
  );
63
61
 
64
62
  // function sucess
@@ -66,7 +64,7 @@ unexpected character: '3' at 0 pos, expected: '4' at '' line
66
64
  () => is_primitive('34', () => true, `Equal`),
67
65
  [`Ok: Equal, got: '34'`],
68
66
  [],
69
- `function sucess`
67
+ `function sucess`,
70
68
  );
71
69
 
72
70
  // function failure
@@ -74,7 +72,7 @@ unexpected character: '3' at 0 pos, expected: '4' at '' line
74
72
  () => is_primitive('34a', () => false, `Equal`),
75
73
  [],
76
74
  [`Failed: Equal, got: '34a', expected: () => false`],
77
- `function failure`
75
+ `function failure`,
78
76
  );
79
77
 
80
78
  // type mispatch failure
@@ -84,6 +82,6 @@ unexpected character: '3' at 0 pos, expected: '4' at '' line
84
82
  [
85
83
  `Failed: Not equal type mismatch, got type: number, expected type: string, got value: 3, expected value: '3'`,
86
84
  ],
87
- `type mispatch failure failure`
85
+ `type mispatch failure failure`,
88
86
  );
89
- };
87
+ }
@@ -1,14 +1,12 @@
1
- 'use strict';
1
+ import { is_string, is_output } from './test.js';
2
2
 
3
- const { is_string, is_output } = require('./test.js');
4
-
5
- module.exports.test = async () => {
3
+ export async function test() {
6
4
  // success
7
5
  await is_output(
8
6
  () => is_string('Success', 'Success', `Strings equal`),
9
7
  [`Ok: Strings equal, got: Success\n`],
10
8
  [],
11
- `success`
9
+ `success`,
12
10
  );
13
11
 
14
12
  // failure
@@ -16,13 +14,13 @@ module.exports.test = async () => {
16
14
  () => is_string('Success', 'Fail', `Strings not equal`),
17
15
  [],
18
16
  [
19
- `Failed: Strings not equal;
17
+ `Failed: Strings not equal;
20
18
  got:
21
19
  Success
22
20
  expected:
23
21
  Fail
24
22
  unexpected character: 'S' at 0 pos, expected: 'F' at '' line\n`,
25
23
  ],
26
- `failure`
24
+ `failure`,
27
25
  );
28
- };
26
+ }
@@ -1,8 +1,6 @@
1
- 'use strict';
1
+ import { ok, is_output } from './test.js';
2
2
 
3
- const { ok, is_output } = require('./test.js');
4
-
5
- module.exports.test = async () => {
3
+ export async function test() {
6
4
  // ok() sucess
7
5
  await is_output(() => ok(true, `Ok`), [`Ok: Ok`], [], `ok() sucess`);
8
6
 
@@ -11,6 +9,6 @@ module.exports.test = async () => {
11
9
  () => ok(false, `Not ok`),
12
10
  [],
13
11
  [`Failed: Not ok`],
14
- `ok() failure`
12
+ `ok() failure`,
15
13
  );
16
- };
14
+ }
@@ -1,9 +1,7 @@
1
- 'use strict';
1
+ import { is } from '../../index.js';
2
+ import { stringify } from '../../core/util.js';
2
3
 
3
- const { is } = require('../../index.js');
4
- const { stringify } = require('../../core/util.js');
5
-
6
- module.exports.test = () => {
4
+ export function test() {
7
5
  is(stringify(null), `null`, 'null');
8
6
  is(stringify(3), `3`, 'number');
9
7
  is(stringify('hi'), `'hi'`, 'string');
@@ -16,7 +14,7 @@ module.exports.test = () => {
16
14
  is(
17
15
  stringify({ a: 3, b: { m: 'hi' } }),
18
16
  `{a: 3, b: {m: 'hi'}}`,
19
- 'object->object'
17
+ 'object->object',
20
18
  );
21
19
  is(stringify(new Set(['v1', 'v2'])), `Set['v1', 'v2']`, 'set');
22
20
  is(stringify(new Map([['key', 'value']])), `Map{key: 'value'}`, 'map');
@@ -27,7 +25,7 @@ module.exports.test = () => {
27
25
  is(
28
26
  stringify(() => 3),
29
27
  `() => 3`,
30
- 'function'
28
+ 'function',
31
29
  );
32
30
 
33
31
  function testo() {
@@ -44,4 +42,4 @@ module.exports.test = () => {
44
42
  const obj = {};
45
43
  obj.self = obj;
46
44
  is(stringify(obj), `{self: recursiveref}`, `recusive reference`);
47
- };
45
+ }
@@ -1,9 +1,7 @@
1
- 'use strict';
1
+ import { ok, test_is, test_contains } from '../../core/base.js';
2
2
 
3
- const { ok, test_is, test_contains } = require('../../core/base.js');
4
-
5
- module.exports.test = async () => {
3
+ export async function test() {
6
4
  // test_is/contains
7
5
  ok(test_is(3, 3), 'test_is');
8
6
  ok(test_contains([0, 1], [1]), 'test_contains');
9
- };
7
+ }
@@ -1,8 +1,6 @@
1
- 'use strict';
1
+ import { is_output, throws, no_throws } from './test.js';
2
2
 
3
- const { is_output, throws, no_throws } = require('./test.js');
4
-
5
- module.exports.test = async () => {
3
+ export async function test() {
6
4
  // throws: success
7
5
  await is_output(
8
6
  () =>
@@ -11,11 +9,11 @@ module.exports.test = async () => {
11
9
  throw new Error('Error#1');
12
10
  },
13
11
  `Error#1`,
14
- `Throws error#1`
12
+ `Throws error#1`,
15
13
  ),
16
14
  [`Ok: Throws error#1, got: Error#1`],
17
15
  [],
18
- `throws sucess`
16
+ `throws sucess`,
19
17
  );
20
18
 
21
19
  // throws: fail, unexpected exception
@@ -26,7 +24,7 @@ module.exports.test = async () => {
26
24
  throw new Error('Error#2');
27
25
  },
28
26
  `Error#1`,
29
- `Wanted error#1`
27
+ `Wanted error#1`,
30
28
  ),
31
29
  [],
32
30
  [
@@ -38,7 +36,7 @@ Error#1
38
36
  unexpected character: '2' at 6 pos, expected: '1' at '' line
39
37
  `,
40
38
  ],
41
- `throws fail, unexpected exception`
39
+ `throws fail, unexpected exception`,
42
40
  );
43
41
 
44
42
  // throws: fail, no exception
@@ -46,7 +44,7 @@ unexpected character: '2' at 6 pos, expected: '1' at '' line
46
44
  () => throws(() => {}, `Error#1`, `Wanted error#1`),
47
45
  [],
48
46
  [`Failed: Wanted error#1: no 'Error#1' exception`],
49
- `throws fail, no exception`
47
+ `throws fail, no exception`,
50
48
  );
51
49
 
52
50
  // no_throws(() => {}, `No exceptions`)
@@ -56,7 +54,7 @@ unexpected character: '2' at 6 pos, expected: '1' at '' line
56
54
  () => no_throws(() => {}, `No exceptions`),
57
55
  [`Ok: No exceptions`],
58
56
  [],
59
- `no throws: sucess`
57
+ `no throws: sucess`,
60
58
  );
61
59
 
62
60
  // no_throws: fail
@@ -70,6 +68,6 @@ unexpected character: '2' at 6 pos, expected: '1' at '' line
70
68
  v => v.startsWith('Error: Error#1'),
71
69
  `Failed: No exceptions, got: Error#1 exception`,
72
70
  ],
73
- `no_throws fail`
71
+ `no_throws fail`,
74
72
  );
75
- };
73
+ }
@@ -1,22 +1,12 @@
1
- 'use strict';
1
+ import { testflow } from '../../core/core.js';
2
+ import { is_output as is_output_base } from '../../core/base.js';
2
3
 
3
- const testflow = require('../../core/core.js');
4
- const base = require('../../core/base.js');
5
-
6
- const scripts = [
7
- '../../core/base.js',
8
- '../../core/core.js',
9
- '../../core/format.js',
10
- ];
11
- for (let script of scripts) {
12
- let script_exports = require(script);
13
- for (let e in script_exports) {
14
- module.exports[e] = script_exports[e];
15
- }
16
- }
4
+ export * from '../../core/base.js';
5
+ export * from '../../core/core.js';
6
+ export * from '../../core/format.js';
17
7
 
18
8
  function is_output(func, out, err, msg) {
19
- return base.is_output(
9
+ return is_output_base(
20
10
  () => {
21
11
  testflow.lock();
22
12
  func();
@@ -24,8 +14,8 @@ function is_output(func, out, err, msg) {
24
14
  },
25
15
  out,
26
16
  err,
27
- msg
17
+ msg,
28
18
  );
29
19
  }
30
20
 
31
- module.exports.is_output = is_output;
21
+ export { is_output };
@@ -2,4 +2,4 @@ const cfg = {
2
2
  invocation: 'sample',
3
3
  };
4
4
 
5
- module.exports = cfg;
5
+ export default cfg;