ng-mocks 10.0.0 → 10.1.1
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/CHANGELOG.md +42 -1
- package/README.md +103 -13
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jasmine.js +2 -2
- package/dist/jasmine.js.map +1 -1
- package/dist/jest.js +2 -2
- package/dist/jest.js.map +1 -1
- package/dist/lib/common/Mock.d.ts +7 -1
- package/dist/lib/common/Mock.js +172 -46
- package/dist/lib/common/Mock.js.map +1 -1
- package/dist/lib/common/decorate.js +82 -22
- package/dist/lib/common/decorate.js.map +1 -1
- package/dist/lib/common/jit-reflector.js +19 -18
- package/dist/lib/common/jit-reflector.js.map +1 -1
- package/dist/lib/common/lib.js +34 -27
- package/dist/lib/common/lib.js.map +1 -1
- package/dist/lib/common/mock-of.decorator.d.ts +2 -1
- package/dist/lib/common/mock-of.decorator.js +4 -8
- package/dist/lib/common/mock-of.decorator.js.map +1 -1
- package/dist/lib/common/ng-mocks-universe.d.ts +2 -1
- package/dist/lib/common/ng-mocks-universe.js +2 -1
- package/dist/lib/common/ng-mocks-universe.js.map +1 -1
- package/dist/lib/common/reflect.js +2 -2
- package/dist/lib/common/reflect.js.map +1 -1
- package/dist/lib/mock-builder/mock-builder.d.ts +2 -2
- package/dist/lib/mock-builder/mock-builder.js +350 -176
- package/dist/lib/mock-builder/mock-builder.js.map +1 -1
- package/dist/lib/mock-component/mock-component.js +152 -80
- package/dist/lib/mock-component/mock-component.js.map +1 -1
- package/dist/lib/mock-declaration/mock-declaration.js +9 -5
- package/dist/lib/mock-declaration/mock-declaration.js.map +1 -1
- package/dist/lib/mock-directive/mock-directive.js +125 -56
- package/dist/lib/mock-directive/mock-directive.js.map +1 -1
- package/dist/lib/mock-helper/mock-helper.d.ts +1 -1
- package/dist/lib/mock-helper/mock-helper.js +233 -122
- package/dist/lib/mock-helper/mock-helper.js.map +1 -1
- package/dist/lib/mock-instance/index.d.ts +1 -0
- package/dist/{es5/lib/mock-helper → lib/mock-instance}/index.js +1 -1
- package/dist/lib/mock-instance/index.js.map +1 -0
- package/dist/lib/mock-instance/mock-instance.d.ts +6 -0
- package/dist/lib/mock-instance/mock-instance.js +30 -0
- package/dist/lib/mock-instance/mock-instance.js.map +1 -0
- package/dist/lib/mock-module/mock-module.js +145 -104
- package/dist/lib/mock-module/mock-module.js.map +1 -1
- package/dist/lib/mock-pipe/mock-pipe.js +52 -25
- package/dist/lib/mock-pipe/mock-pipe.js.map +1 -1
- package/dist/lib/mock-render/mock-render.js +152 -54
- package/dist/lib/mock-render/mock-render.js.map +1 -1
- package/dist/lib/mock-service/mock-service.d.ts +4 -0
- package/dist/lib/mock-service/mock-service.js +238 -68
- package/dist/lib/mock-service/mock-service.js.map +1 -1
- package/package.json +27 -30
- package/dist/es5/index.js +0 -23
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/jasmine.js +0 -5
- package/dist/es5/jasmine.js.map +0 -1
- package/dist/es5/jest.js +0 -5
- package/dist/es5/jest.js.map +0 -1
- package/dist/es5/lib/common/Mock.js +0 -147
- package/dist/es5/lib/common/Mock.js.map +0 -1
- package/dist/es5/lib/common/decorate.js +0 -106
- package/dist/es5/lib/common/decorate.js.map +0 -1
- package/dist/es5/lib/common/index.js +0 -16
- package/dist/es5/lib/common/index.js.map +0 -1
- package/dist/es5/lib/common/jit-reflector.js +0 -33
- package/dist/es5/lib/common/jit-reflector.js.map +0 -1
- package/dist/es5/lib/common/lib.js +0 -106
- package/dist/es5/lib/common/lib.js.map +0 -1
- package/dist/es5/lib/common/mock-of.decorator.js +0 -38
- package/dist/es5/lib/common/mock-of.decorator.js.map +0 -1
- package/dist/es5/lib/common/ng-mocks-universe.js +0 -11
- package/dist/es5/lib/common/ng-mocks-universe.js.map +0 -1
- package/dist/es5/lib/common/reflect.js +0 -10
- package/dist/es5/lib/common/reflect.js.map +0 -1
- package/dist/es5/lib/mock-builder/index.js +0 -14
- package/dist/es5/lib/mock-builder/index.js.map +0 -1
- package/dist/es5/lib/mock-builder/mock-builder.js +0 -525
- package/dist/es5/lib/mock-builder/mock-builder.js.map +0 -1
- package/dist/es5/lib/mock-component/index.js +0 -14
- package/dist/es5/lib/mock-component/index.js.map +0 -1
- package/dist/es5/lib/mock-component/mock-component.js +0 -219
- package/dist/es5/lib/mock-component/mock-component.js.map +0 -1
- package/dist/es5/lib/mock-declaration/index.js +0 -14
- package/dist/es5/lib/mock-declaration/index.js.map +0 -1
- package/dist/es5/lib/mock-declaration/mock-declaration.js +0 -29
- package/dist/es5/lib/mock-declaration/mock-declaration.js.map +0 -1
- package/dist/es5/lib/mock-directive/index.js +0 -14
- package/dist/es5/lib/mock-directive/index.js.map +0 -1
- package/dist/es5/lib/mock-directive/mock-directive.js +0 -174
- package/dist/es5/lib/mock-directive/mock-directive.js.map +0 -1
- package/dist/es5/lib/mock-helper/index.js.map +0 -1
- package/dist/es5/lib/mock-helper/mock-helper.js +0 -327
- package/dist/es5/lib/mock-helper/mock-helper.js.map +0 -1
- package/dist/es5/lib/mock-module/index.js +0 -14
- package/dist/es5/lib/mock-module/index.js.map +0 -1
- package/dist/es5/lib/mock-module/mock-module.js +0 -310
- package/dist/es5/lib/mock-module/mock-module.js.map +0 -1
- package/dist/es5/lib/mock-pipe/index.js +0 -14
- package/dist/es5/lib/mock-pipe/index.js.map +0 -1
- package/dist/es5/lib/mock-pipe/mock-pipe.js +0 -87
- package/dist/es5/lib/mock-pipe/mock-pipe.js.map +0 -1
- package/dist/es5/lib/mock-render/index.js +0 -14
- package/dist/es5/lib/mock-render/index.js.map +0 -1
- package/dist/es5/lib/mock-render/mock-render.js +0 -244
- package/dist/es5/lib/mock-render/mock-render.js.map +0 -1
- package/dist/es5/lib/mock-service/index.js +0 -14
- package/dist/es5/lib/mock-service/index.js.map +0 -1
- package/dist/es5/lib/mock-service/mock-service.js +0 -254
- package/dist/es5/lib/mock-service/mock-service.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,48 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [10.1.1](https://github.com/ike18t/ng-mocks/compare/v10.1.0...v10.1.1) (2020-07-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* unexpected value '[object Object]' exported by the module ([148d659](https://github.com/ike18t/ng-mocks/commit/148d659515fae1d7653aa37c2a0880357ccf7b53)), closes [#173](https://github.com/ike18t/ng-mocks/issues/173)
|
|
11
|
+
|
|
12
|
+
## [10.1.0](https://github.com/ike18t/ng-mocks/compare/v10.0.2...v10.1.0) (2020-07-19)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* extending mocked things via MockInstance ([1ab2c9d](https://github.com/ike18t/ng-mocks/commit/1ab2c9d34b5a54074f9e30f4c39acd32a5f5d2c2)), closes [#170](https://github.com/ike18t/ng-mocks/issues/170)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* injection of NG_VALIDATORS and NgControl ([82dd56a](https://github.com/ike18t/ng-mocks/commit/82dd56a78122e0dc6413d3e3d05bb345fbc0c118)), closes [#167](https://github.com/ike18t/ng-mocks/issues/167)
|
|
23
|
+
|
|
24
|
+
<a name="10.0.2"></a>
|
|
25
|
+
## [10.0.2](https://github.com/ike18t/ng-mocks/compare/v10.0.1...v10.0.2) (2020-07-12)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* skipping mocking of EventManager and DomSharedStylesHost ([84b2720](https://github.com/ike18t/ng-mocks/commit/84b2720)), closes [#162](https://github.com/ike18t/ng-mocks/issues/162)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<a name="10.0.1"></a>
|
|
35
|
+
## [10.0.1](https://github.com/ike18t/ng-mocks/compare/v10.0.0...v10.0.1) (2020-07-12)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* building es5 only that supports es2015 ([d11ed5a](https://github.com/ike18t/ng-mocks/commit/d11ed5a)), closes [#158](https://github.com/ike18t/ng-mocks/issues/158)
|
|
41
|
+
* respect mocks in tokens with useValue ([ccccfc6](https://github.com/ike18t/ng-mocks/commit/ccccfc6)), closes [#151](https://github.com/ike18t/ng-mocks/issues/151)
|
|
42
|
+
* smart injection of NG_VALUE_ACCESSOR ([ad37bf0](https://github.com/ike18t/ng-mocks/commit/ad37bf0)), closes [#157](https://github.com/ike18t/ng-mocks/issues/157)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
5
46
|
<a name="10.0.0"></a>
|
|
6
47
|
# [10.0.0](https://github.com/ike18t/ng-mocks/compare/v9.6.4...v10.0.0) (2020-07-05)
|
|
7
48
|
|
package/README.md
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
Helper function for creating angular mocks for test.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
The current version can be used and has been tested on:
|
|
9
9
|
|
|
10
10
|
- Angular 5 (Jasmine, Jest, es5, es2015)
|
|
11
11
|
- Angular 6 (Jasmine, Jest, es5, es2015)
|
|
12
12
|
- Angular 7 (Jasmine, Jest, es5, es2015)
|
|
13
13
|
- Angular 8 (Jasmine, Jest, es5, es2015)
|
|
14
14
|
- Angular 9 (Jasmine, Jest, Ivy, es5, es2015)
|
|
15
|
-
- Angular 10 (Jasmine, Jest, Ivy,
|
|
15
|
+
- Angular 10 (Jasmine, Jest, Ivy, es5, es2015)
|
|
16
16
|
|
|
17
17
|
## Why use this?
|
|
18
18
|
|
|
@@ -134,19 +134,20 @@ Our tests:
|
|
|
134
134
|
|
|
135
135
|
### Sections:
|
|
136
136
|
|
|
137
|
-
- [
|
|
138
|
-
- [
|
|
139
|
-
- [
|
|
140
|
-
- [
|
|
141
|
-
- [MockModule](#mockmodule)
|
|
137
|
+
- [MockBuilder](#mockbuilder) - facilitates creation of a mocked environment
|
|
138
|
+
- [MockRender](#mockrender) - facilitates rendering of components
|
|
139
|
+
- [MockInstance](#mockinstance) - customizes mocked instances on an early stage
|
|
140
|
+
- [ngMocks](#ngmocks) - facilitates interaction with a fixture, DOM etc.
|
|
142
141
|
|
|
143
|
-
* [
|
|
144
|
-
* [
|
|
145
|
-
* [
|
|
142
|
+
* [MockComponent](#mockcomponents)
|
|
143
|
+
* [MockDirective](#mockdirectives)
|
|
144
|
+
* [MockPipe](#mockpipes)
|
|
145
|
+
* [MockDeclaration](#mockdeclarations)
|
|
146
|
+
* [MockModule](#mockmodule)
|
|
146
147
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
* [Reactive Forms Components](#mocked-reactive-forms-components)
|
|
149
|
+
* [Structural Components](#usage-example-of-structural-directives)
|
|
150
|
+
* [Auto Spy](#auto-spy)
|
|
150
151
|
|
|
151
152
|
---
|
|
152
153
|
|
|
@@ -800,6 +801,95 @@ describe('MockRender', () => {
|
|
|
800
801
|
|
|
801
802
|
---
|
|
802
803
|
|
|
804
|
+
## MockInstance
|
|
805
|
+
|
|
806
|
+
`MockInstance` is useful when you want to configure spies of a component before it has been rendered.
|
|
807
|
+
|
|
808
|
+
MockInstance supports: Modules, Components, Directives, Pipes and Services.
|
|
809
|
+
|
|
810
|
+
```typescript
|
|
811
|
+
MockInstance(MyComponent, {
|
|
812
|
+
init: (instance: MyComponent, injector: Injector): void => {
|
|
813
|
+
// Now you can customize a mocked instance of MyComponent.
|
|
814
|
+
// If you use auto-spy then all methods have been spied already here.
|
|
815
|
+
},
|
|
816
|
+
});
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
After a test you can reset changes to avoid their influence in other tests via a call of `MockReset()`.
|
|
820
|
+
|
|
821
|
+
<details><summary>Click to see <strong>a usage example</strong></summary>
|
|
822
|
+
<p>
|
|
823
|
+
|
|
824
|
+
```typescript
|
|
825
|
+
import { AfterViewInit, Component, ViewChild } from '@angular/core';
|
|
826
|
+
import { MockBuilder, MockInstance, MockRender, MockReset } from 'ng-mocks';
|
|
827
|
+
import { staticFalse } from 'ng-mocks/dist/tests';
|
|
828
|
+
import { EMPTY, Observable, Subject } from 'rxjs';
|
|
829
|
+
|
|
830
|
+
// A child component that contains update$ the parent component wants to listen to.
|
|
831
|
+
@Component({
|
|
832
|
+
selector: 'target',
|
|
833
|
+
template: '{{ update$ | async }}',
|
|
834
|
+
})
|
|
835
|
+
export class TargetComponent {
|
|
836
|
+
public update$: Observable<void>;
|
|
837
|
+
|
|
838
|
+
constructor() {
|
|
839
|
+
const subject = new Subject<void>();
|
|
840
|
+
this.update$ = subject;
|
|
841
|
+
subject.complete();
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
// A parent component that uses @ViewChild to listen to update$ of its child component.
|
|
846
|
+
@Component({
|
|
847
|
+
selector: 'real',
|
|
848
|
+
template: '<target></target>',
|
|
849
|
+
})
|
|
850
|
+
export class RealComponent implements AfterViewInit {
|
|
851
|
+
@ViewChild(TargetComponent, { ...staticFalse }) public child: TargetComponent;
|
|
852
|
+
|
|
853
|
+
ngAfterViewInit() {
|
|
854
|
+
this.child.update$.subscribe();
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
describe('MockInstance', () => {
|
|
859
|
+
// A normal setup of the TestBed, TargetComponent will be mocked.
|
|
860
|
+
beforeEach(() => MockBuilder(RealComponent).mock(TargetComponent));
|
|
861
|
+
|
|
862
|
+
beforeEach(() => {
|
|
863
|
+
// Because TargetComponent is mocked its update$ is undefined and
|
|
864
|
+
// ngAfterViewInit of the parent component will fail on .subscribe().
|
|
865
|
+
// Let's fix it via defining custom initialization of the mock.
|
|
866
|
+
MockInstance(TargetComponent, {
|
|
867
|
+
init: (instance, injector) => {
|
|
868
|
+
instance.update$ = EMPTY; // comment this line to check the failure.
|
|
869
|
+
// if you want you can use injector.get(Service) for a more complicated initialization.
|
|
870
|
+
},
|
|
871
|
+
});
|
|
872
|
+
});
|
|
873
|
+
|
|
874
|
+
// Don't forget to reset MockInstance back.
|
|
875
|
+
afterEach(MockReset);
|
|
876
|
+
|
|
877
|
+
it('should render', () => {
|
|
878
|
+
// Without the custom initialization rendering would fail here with
|
|
879
|
+
// "Cannot read property 'subscribe' of undefined"
|
|
880
|
+
const fixture = MockRender(RealComponent);
|
|
881
|
+
|
|
882
|
+
// Let's check that the mocked component has been decorated by the custom initialization.
|
|
883
|
+
expect(fixture.point.componentInstance.child.update$).toBe(EMPTY);
|
|
884
|
+
});
|
|
885
|
+
});
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
</p>
|
|
889
|
+
</details>
|
|
890
|
+
|
|
891
|
+
---
|
|
892
|
+
|
|
803
893
|
## ngMocks
|
|
804
894
|
|
|
805
895
|
ngMocks provides functions to get attribute and structural directives from an element, find components and mock objects.
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './lib/mock-component';
|
|
|
4
4
|
export * from './lib/mock-declaration';
|
|
5
5
|
export * from './lib/mock-directive';
|
|
6
6
|
export * from './lib/mock-helper';
|
|
7
|
+
export * from './lib/mock-instance';
|
|
7
8
|
export * from './lib/mock-module';
|
|
8
9
|
export * from './lib/mock-pipe';
|
|
9
10
|
export * from './lib/mock-render';
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ __exportStar(require("./lib/mock-component"), exports);
|
|
|
16
16
|
__exportStar(require("./lib/mock-declaration"), exports);
|
|
17
17
|
__exportStar(require("./lib/mock-directive"), exports);
|
|
18
18
|
__exportStar(require("./lib/mock-helper"), exports);
|
|
19
|
+
__exportStar(require("./lib/mock-instance"), exports);
|
|
19
20
|
__exportStar(require("./lib/mock-module"), exports);
|
|
20
21
|
__exportStar(require("./lib/mock-pipe"), exports);
|
|
21
22
|
__exportStar(require("./lib/mock-render"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,qDAAmC;AACnC,uDAAqC;AACrC,yDAAuC;AACvC,uDAAqC;AACrC,oDAAkC;AAClC,oDAAkC;AAClC,kDAAgC;AAChC,oDAAkC;AAClC,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,qDAAmC;AACnC,uDAAqC;AACrC,yDAAuC;AACvC,uDAAqC;AACrC,oDAAkC;AAClC,sDAAoC;AACpC,oDAAkC;AAClC,kDAAgC;AAChC,oDAAkC;AAClC,qDAAmC"}
|
package/dist/jasmine.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
ng_mocks_1.mockServiceHelper.registerMockFunction(mockName
|
|
3
|
+
var ng_mocks_1 = require("ng-mocks");
|
|
4
|
+
ng_mocks_1.mockServiceHelper.registerMockFunction(function (mockName) { return jasmine.createSpy(mockName); });
|
|
5
5
|
//# sourceMappingURL=jasmine.js.map
|
package/dist/jasmine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jasmine.js","sourceRoot":"","sources":["../jasmine.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"jasmine.js","sourceRoot":"","sources":["../jasmine.ts"],"names":[],"mappings":";;AAAA,qCAA6C;AAI7C,4BAAiB,CAAC,oBAAoB,CAAC,UAAA,QAAQ,IAAI,OAAA,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,EAA3B,CAA2B,CAAC,CAAC"}
|
package/dist/jest.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
ng_mocks_1.mockServiceHelper.registerMockFunction(name
|
|
3
|
+
var ng_mocks_1 = require("ng-mocks");
|
|
4
|
+
ng_mocks_1.mockServiceHelper.registerMockFunction(function (name) { return jest.fn().mockName(name); });
|
|
5
5
|
//# sourceMappingURL=jest.js.map
|
package/dist/jest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest.js","sourceRoot":"","sources":["../jest.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"jest.js","sourceRoot":"","sources":["../jest.ts"],"names":[],"mappings":";;AAAA,qCAA6C;AAI7C,4BAAiB,CAAC,oBAAoB,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAxB,CAAwB,CAAC,CAAC"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
1
2
|
import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms';
|
|
3
|
+
export declare type ngMocksMockConfig = {
|
|
4
|
+
outputs?: string[];
|
|
5
|
+
setNgValueAccessor?: boolean;
|
|
6
|
+
};
|
|
2
7
|
export declare class Mock {
|
|
3
8
|
readonly __ngMocksMock: true;
|
|
4
|
-
|
|
9
|
+
protected readonly __ngMocksConfig?: ngMocksMockConfig;
|
|
10
|
+
constructor(injector?: Injector);
|
|
5
11
|
}
|
|
6
12
|
export declare class MockControlValueAccessor extends Mock implements ControlValueAccessor, Validator {
|
|
7
13
|
readonly __ngMocksMockControlValueAccessor: true;
|
package/dist/lib/common/Mock.js
CHANGED
|
@@ -1,68 +1,194 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
16
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
19
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20
|
+
};
|
|
21
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
22
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
23
|
+
};
|
|
24
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
25
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
26
|
+
};
|
|
27
|
+
var __values = (this && this.__values) || function(o) {
|
|
28
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
29
|
+
if (m) return m.call(o);
|
|
30
|
+
if (o && typeof o.length === "number") return {
|
|
31
|
+
next: function () {
|
|
32
|
+
if (o && i >= o.length) o = void 0;
|
|
33
|
+
return { value: o && o[i++], done: !o };
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
37
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.MockControlValueAccessor = exports.Mock = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
40
|
+
var core_1 = require("@angular/core");
|
|
41
|
+
var forms_1 = require("@angular/forms");
|
|
42
|
+
var mock_service_1 = require("../mock-service");
|
|
43
|
+
var ng_mocks_universe_1 = require("./ng-mocks-universe");
|
|
44
|
+
var Mock = (function () {
|
|
45
|
+
function Mock(injector) {
|
|
46
|
+
var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f;
|
|
8
47
|
this.__ngMocksMock = true;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
48
|
+
var mockOf = this.constructor.mockOf;
|
|
49
|
+
if (injector && this.__ngMocksConfig && this.__ngMocksConfig.setNgValueAccessor) {
|
|
50
|
+
try {
|
|
51
|
+
var ngControl = injector.get(forms_1.NgControl, undefined, 10);
|
|
52
|
+
if (ngControl && !ngControl.valueAccessor) {
|
|
53
|
+
ngControl.valueAccessor = this;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
var mockedOutputs = [];
|
|
60
|
+
try {
|
|
61
|
+
for (var _g = __values(this.__ngMocksConfig && this.__ngMocksConfig.outputs ? this.__ngMocksConfig.outputs : []), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
62
|
+
var output = _h.value;
|
|
63
|
+
mockedOutputs.push(output.split(':')[0]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
67
|
+
finally {
|
|
68
|
+
try {
|
|
69
|
+
if (_h && !_h.done && (_a = _g.return)) _a.call(_g);
|
|
70
|
+
}
|
|
71
|
+
finally { if (e_1) throw e_1.error; }
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
for (var mockedOutputs_1 = __values(mockedOutputs), mockedOutputs_1_1 = mockedOutputs_1.next(); !mockedOutputs_1_1.done; mockedOutputs_1_1 = mockedOutputs_1.next()) {
|
|
75
|
+
var output = mockedOutputs_1_1.value;
|
|
76
|
+
if (this[output] || Object.getOwnPropertyDescriptor(this, output)) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
this[output] = new core_1.EventEmitter();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
83
|
+
finally {
|
|
84
|
+
try {
|
|
85
|
+
if (mockedOutputs_1_1 && !mockedOutputs_1_1.done && (_b = mockedOutputs_1.return)) _b.call(mockedOutputs_1);
|
|
86
|
+
}
|
|
87
|
+
finally { if (e_2) throw e_2.error; }
|
|
88
|
+
}
|
|
89
|
+
var prototype = Object.getPrototypeOf(this);
|
|
90
|
+
try {
|
|
91
|
+
for (var _j = __values(mock_service_1.mockServiceHelper.extractMethodsFromPrototype(prototype)), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
92
|
+
var method = _k.value;
|
|
93
|
+
var descriptor = mock_service_1.mockServiceHelper.extractPropertyDescriptor(prototype, method);
|
|
94
|
+
if (descriptor) {
|
|
95
|
+
Object.defineProperty(this, method, descriptor);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
100
|
+
finally {
|
|
101
|
+
try {
|
|
102
|
+
if (_k && !_k.done && (_c = _j.return)) _c.call(_j);
|
|
12
103
|
}
|
|
13
|
-
|
|
104
|
+
finally { if (e_3) throw e_3.error; }
|
|
14
105
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
106
|
+
try {
|
|
107
|
+
for (var _l = __values(mock_service_1.mockServiceHelper.extractPropertiesFromPrototype(prototype)), _m = _l.next(); !_m.done; _m = _l.next()) {
|
|
108
|
+
var prop = _m.value;
|
|
109
|
+
var descriptor = mock_service_1.mockServiceHelper.extractPropertyDescriptor(prototype, prop);
|
|
110
|
+
if (!descriptor) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
Object.defineProperty(this, prop, descriptor);
|
|
20
114
|
}
|
|
21
115
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
116
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
117
|
+
finally {
|
|
118
|
+
try {
|
|
119
|
+
if (_m && !_m.done && (_d = _l.return)) _d.call(_l);
|
|
26
120
|
}
|
|
27
|
-
|
|
121
|
+
finally { if (e_4) throw e_4.error; }
|
|
28
122
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
123
|
+
try {
|
|
124
|
+
for (var _o = __values(mock_service_1.mockServiceHelper.extractMethodsFromPrototype(mockOf.prototype)), _p = _o.next(); !_p.done; _p = _o.next()) {
|
|
125
|
+
var method = _p.value;
|
|
126
|
+
if (this[method] || Object.getOwnPropertyDescriptor(this, method)) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
mock_service_1.mockServiceHelper.mock(this, method);
|
|
32
130
|
}
|
|
33
|
-
mock_service_1.mockServiceHelper.mock(this, method);
|
|
34
131
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
132
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
133
|
+
finally {
|
|
134
|
+
try {
|
|
135
|
+
if (_p && !_p.done && (_e = _o.return)) _e.call(_o);
|
|
38
136
|
}
|
|
39
|
-
|
|
40
|
-
|
|
137
|
+
finally { if (e_5) throw e_5.error; }
|
|
138
|
+
}
|
|
139
|
+
try {
|
|
140
|
+
for (var _q = __values(mock_service_1.mockServiceHelper.extractPropertiesFromPrototype(mockOf.prototype)), _r = _q.next(); !_r.done; _r = _q.next()) {
|
|
141
|
+
var prop = _r.value;
|
|
142
|
+
if (this[prop] || Object.getOwnPropertyDescriptor(this, prop)) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
mock_service_1.mockServiceHelper.mock(this, prop, 'get');
|
|
146
|
+
mock_service_1.mockServiceHelper.mock(this, prop, 'set');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
150
|
+
finally {
|
|
151
|
+
try {
|
|
152
|
+
if (_r && !_r.done && (_f = _q.return)) _f.call(_q);
|
|
153
|
+
}
|
|
154
|
+
finally { if (e_6) throw e_6.error; }
|
|
155
|
+
}
|
|
156
|
+
Object.setPrototypeOf(this, mockOf.prototype);
|
|
157
|
+
var config = ng_mocks_universe_1.ngMocksUniverse.config.get(mockOf);
|
|
158
|
+
if (config && config.init && config.init) {
|
|
159
|
+
config.init(this, injector);
|
|
41
160
|
}
|
|
42
|
-
Object.setPrototypeOf(this, this.constructor.mockOf.prototype);
|
|
43
161
|
}
|
|
44
|
-
|
|
162
|
+
Mock = __decorate([
|
|
163
|
+
__param(0, core_1.Optional()),
|
|
164
|
+
__metadata("design:paramtypes", [core_1.Injector])
|
|
165
|
+
], Mock);
|
|
166
|
+
return Mock;
|
|
167
|
+
}());
|
|
45
168
|
exports.Mock = Mock;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
169
|
+
var MockControlValueAccessor = (function (_super) {
|
|
170
|
+
__extends(MockControlValueAccessor, _super);
|
|
171
|
+
function MockControlValueAccessor() {
|
|
172
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
173
|
+
_this.__ngMocksMockControlValueAccessor = true;
|
|
174
|
+
_this.__simulateChange = function (value) { };
|
|
175
|
+
_this.__simulateTouch = function () { };
|
|
176
|
+
_this.__simulateValidatorChange = function () { };
|
|
177
|
+
_this.setDisabledState = function (isDisabled) { };
|
|
178
|
+
_this.validate = function (control) { return null; };
|
|
179
|
+
_this.writeValue = function (value) { };
|
|
180
|
+
return _this;
|
|
56
181
|
}
|
|
57
|
-
registerOnChange(fn) {
|
|
182
|
+
MockControlValueAccessor.prototype.registerOnChange = function (fn) {
|
|
58
183
|
this.__simulateChange = fn;
|
|
59
|
-
}
|
|
60
|
-
registerOnTouched(fn) {
|
|
184
|
+
};
|
|
185
|
+
MockControlValueAccessor.prototype.registerOnTouched = function (fn) {
|
|
61
186
|
this.__simulateTouch = fn;
|
|
62
|
-
}
|
|
63
|
-
registerOnValidatorChange(fn) {
|
|
187
|
+
};
|
|
188
|
+
MockControlValueAccessor.prototype.registerOnValidatorChange = function (fn) {
|
|
64
189
|
this.__simulateValidatorChange = fn;
|
|
65
|
-
}
|
|
66
|
-
|
|
190
|
+
};
|
|
191
|
+
return MockControlValueAccessor;
|
|
192
|
+
}(Mock));
|
|
67
193
|
exports.MockControlValueAccessor = MockControlValueAccessor;
|
|
68
194
|
//# sourceMappingURL=Mock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mock.js","sourceRoot":"","sources":["../../../lib/common/Mock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Mock.js","sourceRoot":"","sources":["../../../lib/common/Mock.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,44 +1,104 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __values = (this && this.__values) || function(o) {
|
|
3
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
+
if (m) return m.call(o);
|
|
5
|
+
if (o && typeof o.length === "number") return {
|
|
6
|
+
next: function () {
|
|
7
|
+
if (o && i >= o.length) o = void 0;
|
|
8
|
+
return { value: o && o[i++], done: !o };
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
+
};
|
|
13
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o), r, ar = [], e;
|
|
17
|
+
try {
|
|
18
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
+
}
|
|
20
|
+
catch (error) { e = { error: error }; }
|
|
21
|
+
finally {
|
|
22
|
+
try {
|
|
23
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
+
}
|
|
25
|
+
finally { if (e) throw e.error; }
|
|
26
|
+
}
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.decorateQueries = exports.decorateOutputs = exports.decorateInputs = void 0;
|
|
4
|
-
|
|
31
|
+
var core_1 = require("@angular/core");
|
|
5
32
|
function decorateInputs(cls, inputs) {
|
|
33
|
+
var e_1, _a;
|
|
6
34
|
if (inputs) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
35
|
+
try {
|
|
36
|
+
for (var inputs_1 = __values(inputs), inputs_1_1 = inputs_1.next(); !inputs_1_1.done; inputs_1_1 = inputs_1.next()) {
|
|
37
|
+
var input = inputs_1_1.value;
|
|
38
|
+
var _b = __read(input.split(': '), 2), key = _b[0], alias = _b[1];
|
|
39
|
+
core_1.Input(alias)(cls.prototype, key);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
43
|
+
finally {
|
|
44
|
+
try {
|
|
45
|
+
if (inputs_1_1 && !inputs_1_1.done && (_a = inputs_1.return)) _a.call(inputs_1);
|
|
46
|
+
}
|
|
47
|
+
finally { if (e_1) throw e_1.error; }
|
|
10
48
|
}
|
|
11
49
|
}
|
|
12
50
|
}
|
|
13
51
|
exports.decorateInputs = decorateInputs;
|
|
14
52
|
function decorateOutputs(cls, outputs) {
|
|
53
|
+
var e_2, _a;
|
|
15
54
|
if (outputs) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
55
|
+
try {
|
|
56
|
+
for (var outputs_1 = __values(outputs), outputs_1_1 = outputs_1.next(); !outputs_1_1.done; outputs_1_1 = outputs_1.next()) {
|
|
57
|
+
var output = outputs_1_1.value;
|
|
58
|
+
var _b = __read(output.split(': '), 2), key = _b[0], alias = _b[1];
|
|
59
|
+
core_1.Output(alias)(cls.prototype, key);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
63
|
+
finally {
|
|
64
|
+
try {
|
|
65
|
+
if (outputs_1_1 && !outputs_1_1.done && (_a = outputs_1.return)) _a.call(outputs_1);
|
|
66
|
+
}
|
|
67
|
+
finally { if (e_2) throw e_2.error; }
|
|
19
68
|
}
|
|
20
69
|
}
|
|
21
70
|
}
|
|
22
71
|
exports.decorateOutputs = decorateOutputs;
|
|
23
72
|
function decorateQueries(cls, queries) {
|
|
73
|
+
var e_3, _a;
|
|
24
74
|
if (queries) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
75
|
+
try {
|
|
76
|
+
for (var _b = __values(Object.keys(queries)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
77
|
+
var key = _c.value;
|
|
78
|
+
var query = queries[key];
|
|
79
|
+
if (!query) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (query.ngMetadataName === 'ContentChild') {
|
|
83
|
+
core_1.ContentChild(query.selector, query)(cls.prototype, key);
|
|
84
|
+
}
|
|
85
|
+
if (query.ngMetadataName === 'ContentChildren') {
|
|
86
|
+
core_1.ContentChildren(query.selector, query)(cls.prototype, key);
|
|
87
|
+
}
|
|
88
|
+
if (query.ngMetadataName === 'ViewChild') {
|
|
89
|
+
core_1.ViewChild(query.selector, query)(cls.prototype, key);
|
|
90
|
+
}
|
|
91
|
+
if (query.ngMetadataName === 'ViewChildren') {
|
|
92
|
+
core_1.ViewChildren(query.selector, query)(cls.prototype, key);
|
|
93
|
+
}
|
|
32
94
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
if (query.ngMetadataName === 'ViewChildren') {
|
|
40
|
-
core_1.ViewChildren(query.selector, query)(cls.prototype, key);
|
|
95
|
+
}
|
|
96
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
97
|
+
finally {
|
|
98
|
+
try {
|
|
99
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
41
100
|
}
|
|
101
|
+
finally { if (e_3) throw e_3.error; }
|
|
42
102
|
}
|
|
43
103
|
}
|
|
44
104
|
}
|