ng-mocks 14.7.1 → 14.7.2
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 +1 -0
- package/index.d.ts +12 -12
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ The current version of the library **has been tested** and **can be used** with:
|
|
|
15
15
|
|
|
16
16
|
| Angular | ng-mocks | Jasmine | Jest | Ivy |
|
|
17
17
|
| ------: | :------: | :-----: | :--: | :-: |
|
|
18
|
+
| 16 | latest | yes | yes | yes |
|
|
18
19
|
| 15 | latest | yes | yes | yes |
|
|
19
20
|
| 14 | latest | yes | yes | yes |
|
|
20
21
|
| 13 | latest | yes | yes | yes |
|
package/index.d.ts
CHANGED
|
@@ -1402,38 +1402,38 @@ export declare function MockProvider<I>(provider: AnyDeclaration<I>, value: Fact
|
|
|
1402
1402
|
export declare function MockService(service: boolean | number | string | null | undefined): undefined;
|
|
1403
1403
|
/**
|
|
1404
1404
|
* MockService creates a mock instance out of an object or a class.
|
|
1405
|
-
* The second parameter can be used as overrides.
|
|
1406
1405
|
*
|
|
1407
1406
|
* @see https://ng-mocks.sudo.eu/api/MockService
|
|
1408
1407
|
*
|
|
1409
1408
|
* ```ts
|
|
1410
|
-
* const service = MockService(AuthService
|
|
1411
|
-
* loggedIn: true,
|
|
1412
|
-
* });
|
|
1409
|
+
* const service = MockService(AuthService);
|
|
1413
1410
|
* service.login(); // does nothing, it's dummy.
|
|
1414
|
-
* ```
|
|
1415
1411
|
*/
|
|
1416
|
-
export declare function MockService<T>(service: AnyType<T>,
|
|
1412
|
+
export declare function MockService<T>(service: AnyType<T>, spyNamePrefix?: string): T;
|
|
1417
1413
|
/**
|
|
1418
1414
|
* MockService creates a mock instance out of an object or a class.
|
|
1419
1415
|
*
|
|
1420
1416
|
* @see https://ng-mocks.sudo.eu/api/MockService
|
|
1421
1417
|
*
|
|
1422
1418
|
* ```ts
|
|
1423
|
-
* const
|
|
1424
|
-
*
|
|
1419
|
+
* const mockUser = MockService(currentUser);
|
|
1420
|
+
* mockUser.save(); // does nothing, it's dummy.
|
|
1425
1421
|
*/
|
|
1426
|
-
export declare function MockService<T>(service:
|
|
1422
|
+
export declare function MockService<T = any>(service: object, spyNamePrefix?: string): T;
|
|
1427
1423
|
/**
|
|
1428
1424
|
* MockService creates a mock instance out of an object or a class.
|
|
1425
|
+
* The second parameter can be used as overrides.
|
|
1429
1426
|
*
|
|
1430
1427
|
* @see https://ng-mocks.sudo.eu/api/MockService
|
|
1431
1428
|
*
|
|
1432
1429
|
* ```ts
|
|
1433
|
-
* const
|
|
1434
|
-
*
|
|
1430
|
+
* const service = MockService(AuthService, {
|
|
1431
|
+
* loggedIn: true,
|
|
1432
|
+
* });
|
|
1433
|
+
* service.login(); // does nothing, it's dummy.
|
|
1434
|
+
* ```
|
|
1435
1435
|
*/
|
|
1436
|
-
export declare function MockService<T
|
|
1436
|
+
export declare function MockService<T>(service: AnyType<T>, overrides?: Partial<T>, spyNamePrefix?: string): T;
|
|
1437
1437
|
/**
|
|
1438
1438
|
* MockedDebugNode is a way to simplify the type of DebugNode.
|
|
1439
1439
|
* Usually, it should not be used externally.
|