@camperaid/watest 2.4.6 → 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.
- package/.prettierrc.js +1 -3
- package/.watestrc.js +1 -3
- package/bin/watest.js +3 -8
- package/core/base.js +79 -56
- package/core/core.js +25 -45
- package/core/format.js +96 -56
- package/core/process_args.js +1 -5
- package/core/series.js +60 -56
- package/core/settings.js +27 -32
- package/core/spawn.js +14 -21
- package/core/util.js +12 -19
- package/eslint.config.js +27 -0
- package/index.js +15 -17
- package/interfaces/logger.js +1 -3
- package/interfaces/servicer.js +1 -3
- package/logging/filestream.js +3 -7
- package/logging/logging.js +5 -11
- package/logging/logpipe.js +21 -21
- package/package.json +12 -11
- package/tests/base/t_api.js +3 -6
- package/tests/base/t_contains.js +12 -12
- package/tests/base/t_core.js +11 -8
- package/tests/base/t_format.js +13 -14
- package/tests/base/t_is.js +9 -11
- package/tests/base/t_is_object.js +23 -25
- package/tests/base/t_is_primitive.js +12 -14
- package/tests/base/t_is_string.js +6 -8
- package/tests/base/t_ok.js +4 -6
- package/tests/base/t_stringify.js +6 -8
- package/tests/base/t_test_.js +3 -5
- package/tests/base/t_throws.js +73 -0
- package/tests/base/test.js +8 -18
- package/tests/e2e/samples/{loader/.watestrc.cjs → folder/.watestrc.js} +1 -1
- package/tests/e2e/samples/folder/package-lock.json +1019 -5940
- package/tests/e2e/samples/folder/package.json +3 -2
- package/tests/e2e/samples/folder/tests/meta.js +1 -1
- package/tests/e2e/samples/folder/tests/unit/t_test.js +3 -3
- package/tests/e2e/samples/{loader_mixed/.watestrc.cjs → loader/.watestrc.js} +1 -1
- package/tests/e2e/samples/loader/package-lock.json +1751 -28
- package/tests/e2e/samples/loader/package.json +2 -2
- package/tests/e2e/samples/{folder/.watestrc.cjs → loader_mixed/.watestrc.js} +1 -1
- package/tests/e2e/samples/loader_mixed/package-lock.json +1751 -28
- package/tests/e2e/samples/loader_multiple/{.watestrc.cjs → .watestrc.js} +1 -1
- package/tests/e2e/samples/loader_multiple/package-lock.json +1751 -28
- package/tests/e2e/samples/loader_multiple/package.json +2 -2
- package/tests/e2e/samples/single/.watestrc.js +5 -0
- package/tests/e2e/samples/single/package-lock.json +1017 -5938
- package/tests/e2e/samples/single/package.json +5 -2
- package/tests/e2e/samples/wd_mixed/{.watestrc.cjs → .watestrc.js} +1 -1
- package/tests/e2e/samples/wd_mixed/package-lock.json +779 -4862
- package/tests/e2e/samples/wd_mixed/package.json +2 -2
- package/tests/e2e/samples/wd_single/{.watestrc.cjs → .watestrc.js} +1 -1
- package/tests/e2e/samples/wd_single/package-lock.json +779 -4862
- package/tests/e2e/samples/wd_single/package.json +2 -2
- package/tests/e2e/t_folder.js +4 -6
- package/tests/e2e/t_loader.js +4 -6
- package/tests/e2e/t_loader_mixed.js +4 -6
- package/tests/e2e/t_loader_multiple.js +4 -6
- package/tests/e2e/t_loader_multiple_patterns.js +4 -6
- package/tests/e2e/t_single.js +4 -6
- package/tests/e2e/t_wd_firefox.js +4 -6
- package/tests/e2e/t_wd_firefox_chrome.js +4 -6
- package/tests/e2e/t_wd_firefox_chrome_pattern.js +4 -6
- package/tests/e2e/t_wd_mixed_firefox.js +4 -6
- package/tests/e2e/t_wd_mixed_firefox_chrome.js +4 -6
- package/tests/e2e/test.js +15 -16
- package/tests/meta.js +1 -3
- package/tests/series/build/t_adjust_names.js +4 -6
- package/tests/series/build/t_adjust_names_webdriver.js +6 -10
- package/tests/series/build/t_expected_failures.js +4 -6
- package/tests/series/build/t_loader.js +4 -6
- package/tests/series/build/t_loader_mixed.js +4 -6
- package/tests/series/build/t_mixed.js +4 -6
- package/tests/series/build/t_nested.js +4 -6
- package/tests/series/build/t_patterns_loader.js +4 -6
- package/tests/series/build/t_patterns_webdriver.js +4 -6
- package/tests/series/build/t_webdriver.js +4 -6
- package/tests/series/build/t_webdriver_firefox_mixed.js +4 -6
- package/tests/series/build/t_webdriver_nested.js +4 -6
- package/tests/series/build/t_webdriver_services.js +4 -6
- package/tests/series/generic/t_failures_info.js +9 -12
- package/tests/series/logging/t_failures.js +18 -20
- package/tests/series/logging/t_success.js +15 -17
- package/tests/series/logging/t_verify.js +17 -14
- package/tests/series/meta.js +1 -3
- package/tests/series/mock_series.js +7 -13
- package/tests/series/perform/t_failure.js +4 -6
- package/tests/series/perform/t_failure_notest.js +4 -6
- package/tests/series/perform/t_intermittent.js +5 -7
- package/tests/series/perform/t_intermittent_global.js +4 -6
- package/tests/series/perform/t_missing_perma.js +5 -7
- package/tests/series/perform/t_nested.js +4 -10
- package/tests/series/perform/t_perma.js +4 -6
- package/tests/series/perform/t_success.js +5 -11
- package/tests/series/run/t_debunk_failure.js +7 -6
- package/tests/series/run/t_debunk_success.js +7 -6
- package/tests/series/run/t_nested.js +7 -6
- package/tests/series/run/t_verify.js +7 -6
- package/tests/series/run/t_verify_webdriver.js +7 -6
- package/tests/series/test.js +29 -40
- package/tests/webdriver/meta.js +1 -3
- package/tests/webdriver/t_app_driver.js +3 -5
- package/tests/webdriver/t_app_driver_selectors.js +3 -5
- package/tests/webdriver/t_attribute.js +5 -7
- package/tests/webdriver/t_attribute_all.js +6 -8
- package/tests/webdriver/t_doubleclick.js +3 -5
- package/tests/webdriver/t_doubleclickat.js +3 -5
- package/tests/webdriver/t_execute.js +4 -6
- package/tests/webdriver/t_if_has_elements.js +6 -8
- package/tests/webdriver/t_if_no_elements.js +6 -8
- package/tests/webdriver/t_no_elements_or_not_visible.js +7 -9
- package/tests/webdriver/t_properties.js +11 -13
- package/tests/webdriver/t_script.js +8 -10
- package/tests/webdriver/t_select_all.js +6 -11
- package/tests/webdriver/t_selection.js +4 -6
- package/tests/webdriver/t_text.js +12 -14
- package/tests/webdriver/t_text_all.js +6 -8
- package/tests/webdriver/test.js +32 -41
- package/webdriver/app_driver.js +15 -19
- package/webdriver/control_driver.js +4 -8
- package/webdriver/driver.js +58 -61
- package/webdriver/driver_base.js +50 -60
- package/webdriver/session.js +6 -11
- package/webdriver/util.js +7 -8
- package/.eslintrc.js +0 -45
- package/index.mjs +0 -5
- package/tests/e2e/samples/folder/node_modules/.package-lock.json +0 -3871
- package/tests/e2e/samples/loader/node_modules/.package-lock.json +0 -36
- package/tests/e2e/samples/loader_mixed/node_modules/.package-lock.json +0 -36
- package/tests/e2e/samples/loader_multiple/node_modules/.package-lock.json +0 -36
- package/tests/e2e/samples/single/.watestrc.cjs +0 -5
- package/tests/e2e/samples/single/node_modules/.package-lock.json +0 -3871
- package/tests/e2e/samples/wd_mixed/node_modules/.package-lock.json +0 -3586
- package/tests/e2e/samples/wd_single/node_modules/.package-lock.json +0 -3586
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { is_output, is_primitive } from './test.js';
|
|
2
2
|
|
|
3
|
-
|
|
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
|
[`[32mOk:[0m 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
|
[`[32mOk:[0m 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
|
[`[32mOk:[0m 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
|
[`[32mOk:[0m 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
|
-
|
|
1
|
+
import { is_string, is_output } from './test.js';
|
|
2
2
|
|
|
3
|
-
|
|
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
|
[`[32mOk:[0m 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
|
-
|
|
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
|
+
}
|
package/tests/base/t_ok.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ok, is_output } from './test.js';
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
1
|
+
import { is } from '../../index.js';
|
|
2
|
+
import { stringify } from '../../core/util.js';
|
|
2
3
|
|
|
3
|
-
|
|
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
|
+
}
|
package/tests/base/t_test_.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { ok, test_is, test_contains } from '../../core/base.js';
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { is_output, throws, no_throws } from './test.js';
|
|
2
|
+
|
|
3
|
+
export async function test() {
|
|
4
|
+
// throws: success
|
|
5
|
+
await is_output(
|
|
6
|
+
() =>
|
|
7
|
+
throws(
|
|
8
|
+
() => {
|
|
9
|
+
throw new Error('Error#1');
|
|
10
|
+
},
|
|
11
|
+
`Error#1`,
|
|
12
|
+
`Throws error#1`,
|
|
13
|
+
),
|
|
14
|
+
[`Ok: Throws error#1, got: Error#1`],
|
|
15
|
+
[],
|
|
16
|
+
`throws sucess`,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
// throws: fail, unexpected exception
|
|
20
|
+
await is_output(
|
|
21
|
+
() =>
|
|
22
|
+
throws(
|
|
23
|
+
() => {
|
|
24
|
+
throw new Error('Error#2');
|
|
25
|
+
},
|
|
26
|
+
`Error#1`,
|
|
27
|
+
`Wanted error#1`,
|
|
28
|
+
),
|
|
29
|
+
[],
|
|
30
|
+
[
|
|
31
|
+
`Failed: Wanted error#1;
|
|
32
|
+
got:
|
|
33
|
+
Error#2
|
|
34
|
+
expected:
|
|
35
|
+
Error#1
|
|
36
|
+
unexpected character: '2' at 6 pos, expected: '1' at '' line
|
|
37
|
+
`,
|
|
38
|
+
],
|
|
39
|
+
`throws fail, unexpected exception`,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// throws: fail, no exception
|
|
43
|
+
await is_output(
|
|
44
|
+
() => throws(() => {}, `Error#1`, `Wanted error#1`),
|
|
45
|
+
[],
|
|
46
|
+
[`Failed: Wanted error#1: no 'Error#1' exception`],
|
|
47
|
+
`throws fail, no exception`,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// no_throws(() => {}, `No exceptions`)
|
|
51
|
+
|
|
52
|
+
// no_throws: success
|
|
53
|
+
await is_output(
|
|
54
|
+
() => no_throws(() => {}, `No exceptions`),
|
|
55
|
+
[`Ok: No exceptions`],
|
|
56
|
+
[],
|
|
57
|
+
`no throws: sucess`,
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
// no_throws: fail
|
|
61
|
+
await is_output(
|
|
62
|
+
() =>
|
|
63
|
+
no_throws(() => {
|
|
64
|
+
throw new Error('Error#1');
|
|
65
|
+
}, `No exceptions`),
|
|
66
|
+
[],
|
|
67
|
+
[
|
|
68
|
+
v => v.startsWith('Error: Error#1'),
|
|
69
|
+
`Failed: No exceptions, got: Error#1 exception`,
|
|
70
|
+
],
|
|
71
|
+
`no_throws fail`,
|
|
72
|
+
);
|
|
73
|
+
}
|
package/tests/base/test.js
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { testflow } from '../../core/core.js';
|
|
2
|
+
import { is_output as is_output_base } from '../../core/base.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
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
|
-
|
|
21
|
+
export { is_output };
|