@appium/test-support 4.0.4 → 4.0.6
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/README.md +2 -0
- package/build/lib/mock-utils.d.ts +3 -0
- package/build/lib/mock-utils.d.ts.map +1 -1
- package/build/lib/mock-utils.js +3 -0
- package/build/lib/mock-utils.js.map +1 -1
- package/build/lib/sandbox-utils.d.ts +3 -0
- package/build/lib/sandbox-utils.d.ts.map +1 -1
- package/build/lib/sandbox-utils.js +3 -0
- package/build/lib/sandbox-utils.js.map +1 -1
- package/lib/mock-utils.js +3 -0
- package/lib/sandbox-utils.js +3 -0
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @appium/test-support
|
|
2
2
|
|
|
3
|
+
> ⚠️ **DEPRECATED**: This module is deprecated. Use `sinon` directly instead (e.g., `sinon.createSandbox()` with Mocha `beforeEach`/`afterEach` hooks).
|
|
4
|
+
|
|
3
5
|
> A collection of test utility libs used across Appium packages
|
|
4
6
|
|
|
5
7
|
[](https://npmjs.org/package/@appium/test-support)
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* _Synchronously_ calls `fn` with the {@linkcode MockStore} after hooks have been created, but not before they have been run.
|
|
8
8
|
*
|
|
9
|
+
* @deprecated Use `sinon.createSandbox()` directly with Mocha `beforeEach`/`afterEach` hooks instead.
|
|
9
10
|
* @param {Record<string|symbol,any>} mockDefs
|
|
10
11
|
* @param {(mocks: MockStore) => void} fn
|
|
11
12
|
* @returns {() => void}
|
|
@@ -13,12 +14,14 @@
|
|
|
13
14
|
export function withMocks(mockDefs: Record<string | symbol, any>, fn: (mocks: MockStore<any>) => void): () => void;
|
|
14
15
|
/**
|
|
15
16
|
* Convenience function for calling `mocks.verify()`.
|
|
17
|
+
* @deprecated Call `sandbox.verify()` directly on your sinon sandbox instead.
|
|
16
18
|
* @param {MockStore} mocks - Returned by callback from {@linkcode withMocks}
|
|
17
19
|
*/
|
|
18
20
|
export function verifyMocks(mocks: MockStore<any>): void;
|
|
19
21
|
/**
|
|
20
22
|
* @template {Record<string,any>} Mocks
|
|
21
23
|
* @extends {Mocks}
|
|
24
|
+
* @deprecated Use `sinon.createSandbox()` and `sandbox.mock()` directly instead.
|
|
22
25
|
*/
|
|
23
26
|
export class MockStore<Mocks extends Record<string, any>> {
|
|
24
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-utils.d.ts","sourceRoot":"","sources":["../../lib/mock-utils.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"mock-utils.d.ts","sourceRoot":"","sources":["../../lib/mock-utils.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,oCAJW,MAAM,CAAC,MAAM,GAAC,MAAM,EAAC,GAAG,CAAC,MACzB,CAAC,KAAK,gBAAW,KAAK,IAAI,GACxB,MAAM,IAAI,CAetB;AAED;;;;GAIG;AACH,yDAEC;AAED;;;;GAIG;AACH,uBAJkC,KAAK,SAAzB,MAAM,CAAC,MAAM,EAAC,GAAG,CAAE;IAiB/B;;;OAGG;IACH,sBAFW,YAAY,EAItB;IAlBD;;;OAGG;IACH,SAFU,YAAY,GAAC,SAAS,CAExB;IAgBR;;OAEG;IACH,sBAFW,KAAK,QAYf;IAED;;OAEG;IACH,eAOC;IAED,cAMC;;CACF;2BAGY,OAAO,OAAO,EAAE,YAAY"}
|
package/build/lib/mock-utils.js
CHANGED
|
@@ -15,6 +15,7 @@ const sinon_1 = __importDefault(require("sinon"));
|
|
|
15
15
|
*
|
|
16
16
|
* _Synchronously_ calls `fn` with the {@linkcode MockStore} after hooks have been created, but not before they have been run.
|
|
17
17
|
*
|
|
18
|
+
* @deprecated Use `sinon.createSandbox()` directly with Mocha `beforeEach`/`afterEach` hooks instead.
|
|
18
19
|
* @param {Record<string|symbol,any>} mockDefs
|
|
19
20
|
* @param {(mocks: MockStore) => void} fn
|
|
20
21
|
* @returns {() => void}
|
|
@@ -35,6 +36,7 @@ function withMocks(mockDefs, fn) {
|
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Convenience function for calling `mocks.verify()`.
|
|
39
|
+
* @deprecated Call `sandbox.verify()` directly on your sinon sandbox instead.
|
|
38
40
|
* @param {MockStore} mocks - Returned by callback from {@linkcode withMocks}
|
|
39
41
|
*/
|
|
40
42
|
function verifyMocks(mocks) {
|
|
@@ -43,6 +45,7 @@ function verifyMocks(mocks) {
|
|
|
43
45
|
/**
|
|
44
46
|
* @template {Record<string,any>} Mocks
|
|
45
47
|
* @extends {Mocks}
|
|
48
|
+
* @deprecated Use `sinon.createSandbox()` and `sandbox.mock()` directly instead.
|
|
46
49
|
*/
|
|
47
50
|
class MockStore {
|
|
48
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-utils.js","sourceRoot":"","sources":["../../lib/mock-utils.js"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"mock-utils.js","sourceRoot":"","sources":["../../lib/mock-utils.js"],"names":[],"mappings":";;;;;;AAeA,8BAaC;AAOD,kCAEC;AArCD,kDAA0B;AAE1B;;;;;;;;;;;;GAYG;AACH,SAAgB,SAAS,CAAC,QAAQ,EAAE,EAAE;IACpC,OAAO,GAAG,EAAE;QACV,MAAM,KAAK,GAAG,IAAI,SAAS,EAAE,CAAC;QAC9B,oDAAoD;QACpD,UAAU,CAAC,SAAS,mBAAmB;YACrC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QACH,oDAAoD;QACpD,SAAS,CAAC,SAAS,kBAAkB;YACnC,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,KAAK,CAAC,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,KAAK;IAC/B,KAAK,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 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @template {Record<string,any>|{mocks: Record<string,any>}} Mocks
|
|
3
|
+
* @deprecated Use `sinon.createSandbox()` directly with Mocha `beforeEach`/`afterEach` hooks instead.
|
|
3
4
|
* @param {Mocks} mockDefs
|
|
4
5
|
* @param {(sandboxStore: SandboxStore) => void} fn
|
|
5
6
|
* @returns {() => void}
|
|
@@ -9,11 +10,13 @@ export function withSandbox<Mocks extends Record<string, any> | {
|
|
|
9
10
|
}>(mockDefs: Mocks, fn: (sandboxStore: SandboxStore<any>) => void): () => void;
|
|
10
11
|
/**
|
|
11
12
|
* Convenience function for calling {@linkcode SandboxStore.verify}.
|
|
13
|
+
* @deprecated Call `sandbox.verify()` directly on your sinon sandbox instead.
|
|
12
14
|
* @param {SandboxStore|MockStore} sbxOrMocks
|
|
13
15
|
*/
|
|
14
16
|
export function verifySandbox(sbxOrMocks: SandboxStore<any> | MockStore<any>): void;
|
|
15
17
|
/**
|
|
16
18
|
* @template {Record<string,any>} Mocks
|
|
19
|
+
* @deprecated Use `sinon.createSandbox()` directly instead.
|
|
17
20
|
*/
|
|
18
21
|
export class SandboxStore<Mocks extends Record<string, any>> {
|
|
19
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-utils.d.ts","sourceRoot":"","sources":["../../lib/sandbox-utils.js"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"sandbox-utils.d.ts","sourceRoot":"","sources":["../../lib/sandbox-utils.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,4BAN8D,KAAK,SAArD,MAAM,CAAC,MAAM,EAAC,GAAG,CAAC,GAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,CAAC,CAAA;CAAE,YAElD,KAAK,MACL,CAAC,YAAY,mBAAc,KAAK,IAAI,GAClC,MAAM,IAAI,CAoBtB;AAED;;;;GAIG;AACH,0CAFW,kCAAsB,QAIhC;AAED;;;GAGG;AACH,0BAHkC,KAAK,SAAzB,MAAM,CAAC,MAAM,EAAC,GAAG,CAAE;IAU/B;;;OAGG;IACH,sBAFW,YAAY,EAItB;IAZD,4CAA4C;IAC5C,OADW,SAAS,CAAC,MAAM,CAAC,MAAM,EAAC,GAAG,CAAC,CAAC,CAClC;IAEN,qCAAqC;IACrC,SADW,YAAY,GAAC,SAAS,CACzB;IAUR;;OAEG;IACH,sBAFW,KAAK,QAKf;IAED;;OAEG;IACH,eAOC;IAED,cAGC;CACF;2BAGY,OAAO,OAAO,EAAE,YAAY;0BApFjB,cAAc"}
|
|
@@ -11,6 +11,7 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
11
11
|
const mock_utils_1 = require("./mock-utils");
|
|
12
12
|
/**
|
|
13
13
|
* @template {Record<string,any>|{mocks: Record<string,any>}} Mocks
|
|
14
|
+
* @deprecated Use `sinon.createSandbox()` directly with Mocha `beforeEach`/`afterEach` hooks instead.
|
|
14
15
|
* @param {Mocks} mockDefs
|
|
15
16
|
* @param {(sandboxStore: SandboxStore) => void} fn
|
|
16
17
|
* @returns {() => void}
|
|
@@ -36,6 +37,7 @@ function withSandbox(mockDefs, fn) {
|
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Convenience function for calling {@linkcode SandboxStore.verify}.
|
|
40
|
+
* @deprecated Call `sandbox.verify()` directly on your sinon sandbox instead.
|
|
39
41
|
* @param {SandboxStore|MockStore} sbxOrMocks
|
|
40
42
|
*/
|
|
41
43
|
function verifySandbox(sbxOrMocks) {
|
|
@@ -43,6 +45,7 @@ function verifySandbox(sbxOrMocks) {
|
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* @template {Record<string,any>} Mocks
|
|
48
|
+
* @deprecated Use `sinon.createSandbox()` directly instead.
|
|
46
49
|
*/
|
|
47
50
|
class SandboxStore {
|
|
48
51
|
/** @type {MockStore<Record<string,any>>} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-utils.js","sourceRoot":"","sources":["../../lib/sandbox-utils.js"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"sandbox-utils.js","sourceRoot":"","sources":["../../lib/sandbox-utils.js"],"names":[],"mappings":";;;;;;AAWA,kCAkBC;AAOD,sCAEC;AAtCD,kDAA0B;AAC1B,oDAAuB;AACvB,6CAAuC;AAEvC;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,QAAQ,EAAE,EAAE;IACtC,mBAAmB;IACnB,IAAI,CAAC,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAC5B,CAAC;IACD,OAAO,GAAG,EAAE;QACV,2BAA2B;QAC3B,MAAM,GAAG,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,oDAAoD;QACpD,UAAU,CAAC,SAAS,UAAU;YAC5B,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QACH,oDAAoD;QACpD,SAAS,CAAC,SAAS,SAAS;YAC1B,GAAG,CAAC,KAAK,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,GAAG,CAAC,CAAC;IACV,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,UAAU;IACtC,UAAU,CAAC,MAAM,EAAE,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,MAAa,YAAY;IACvB,4CAA4C;IAC5C,KAAK,CAAC;IAEN,qCAAqC;IACrC,OAAO,CAAC;IAER;;;OAGG;IACH,YAAY,OAAO;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,KAAK,GAAG,oBAAoB,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,eAAK,CAAC,aAAa,EAAE,CAAC;QACrD,IAAI,CAAC,KAAK,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,cAAc,CACtB,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAvCD,oCAuCC;AAED;;GAEG"}
|
package/lib/mock-utils.js
CHANGED
|
@@ -8,6 +8,7 @@ import sinon from 'sinon';
|
|
|
8
8
|
*
|
|
9
9
|
* _Synchronously_ calls `fn` with the {@linkcode MockStore} after hooks have been created, but not before they have been run.
|
|
10
10
|
*
|
|
11
|
+
* @deprecated Use `sinon.createSandbox()` directly with Mocha `beforeEach`/`afterEach` hooks instead.
|
|
11
12
|
* @param {Record<string|symbol,any>} mockDefs
|
|
12
13
|
* @param {(mocks: MockStore) => void} fn
|
|
13
14
|
* @returns {() => void}
|
|
@@ -29,6 +30,7 @@ export function withMocks(mockDefs, fn) {
|
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Convenience function for calling `mocks.verify()`.
|
|
33
|
+
* @deprecated Call `sandbox.verify()` directly on your sinon sandbox instead.
|
|
32
34
|
* @param {MockStore} mocks - Returned by callback from {@linkcode withMocks}
|
|
33
35
|
*/
|
|
34
36
|
export function verifyMocks(mocks) {
|
|
@@ -38,6 +40,7 @@ export function verifyMocks(mocks) {
|
|
|
38
40
|
/**
|
|
39
41
|
* @template {Record<string,any>} Mocks
|
|
40
42
|
* @extends {Mocks}
|
|
43
|
+
* @deprecated Use `sinon.createSandbox()` and `sandbox.mock()` directly instead.
|
|
41
44
|
*/
|
|
42
45
|
export class MockStore {
|
|
43
46
|
/**
|
package/lib/sandbox-utils.js
CHANGED
|
@@ -4,6 +4,7 @@ import {MockStore} from './mock-utils';
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @template {Record<string,any>|{mocks: Record<string,any>}} Mocks
|
|
7
|
+
* @deprecated Use `sinon.createSandbox()` directly with Mocha `beforeEach`/`afterEach` hooks instead.
|
|
7
8
|
* @param {Mocks} mockDefs
|
|
8
9
|
* @param {(sandboxStore: SandboxStore) => void} fn
|
|
9
10
|
* @returns {() => void}
|
|
@@ -30,6 +31,7 @@ export function withSandbox(mockDefs, fn) {
|
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Convenience function for calling {@linkcode SandboxStore.verify}.
|
|
34
|
+
* @deprecated Call `sandbox.verify()` directly on your sinon sandbox instead.
|
|
33
35
|
* @param {SandboxStore|MockStore} sbxOrMocks
|
|
34
36
|
*/
|
|
35
37
|
export function verifySandbox(sbxOrMocks) {
|
|
@@ -38,6 +40,7 @@ export function verifySandbox(sbxOrMocks) {
|
|
|
38
40
|
|
|
39
41
|
/**
|
|
40
42
|
* @template {Record<string,any>} Mocks
|
|
43
|
+
* @deprecated Use `sinon.createSandbox()` directly instead.
|
|
41
44
|
*/
|
|
42
45
|
export class SandboxStore {
|
|
43
46
|
/** @type {MockStore<Record<string,any>>} */
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appium/test-support",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6",
|
|
4
4
|
"description": "A collection of test utilities used across Appium packages",
|
|
5
|
+
"deprecated": "This module is deprecated. Use sinon directly instead (e.g., sinon.createSandbox() with Mocha hooks).",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"automation",
|
|
7
8
|
"javascript",
|
|
@@ -37,7 +38,8 @@
|
|
|
37
38
|
"lib",
|
|
38
39
|
"build",
|
|
39
40
|
"tsconfig.json",
|
|
40
|
-
"!build/tsconfig.tsbuildinfo"
|
|
41
|
+
"!build/tsconfig.tsbuildinfo",
|
|
42
|
+
"!build/test"
|
|
41
43
|
],
|
|
42
44
|
"scripts": {
|
|
43
45
|
"test": "npm run test:unit",
|
|
@@ -45,13 +47,12 @@
|
|
|
45
47
|
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
|
|
46
48
|
},
|
|
47
49
|
"dependencies": {
|
|
48
|
-
"@appium/support": "^7.0.
|
|
50
|
+
"@appium/support": "^7.0.6",
|
|
49
51
|
"@colors/colors": "1.6.0",
|
|
50
52
|
"bluebird": "3.7.2",
|
|
51
|
-
"lodash": "4.17.
|
|
53
|
+
"lodash": "4.17.23",
|
|
52
54
|
"loud-rejection": "2.2.0",
|
|
53
|
-
"sinon": "21.0.
|
|
54
|
-
"source-map-support": "0.5.21"
|
|
55
|
+
"sinon": "21.0.2"
|
|
55
56
|
},
|
|
56
57
|
"engines": {
|
|
57
58
|
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
@@ -60,5 +61,5 @@
|
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"access": "public"
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "980a121804ae006db879fb6860f627ac36174c15"
|
|
64
65
|
}
|