New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ng-mocks

Package Overview
Dependencies
Maintainers
1
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-mocks - npm Package Compare versions

Comparing version 7.0.1 to 7.1.0

dist/lib/mock-component/test-components/template-outlet.component.d.ts

216

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="7.1.0"></a>
# 7.1.0 (2018-11-01)
### Bug Fixes
* trim innerText that was getting a new line from a div ([f883ad0](https://github.com/ike18t/ng-mocks/commit/f883ad0))
<a name="7.0.1"></a>

@@ -212,2 +222,12 @@ ## 7.0.1 (2018-10-26)

<a name="7.0.1"></a>
## 7.0.1 (2018-10-26)
### Bug Fixes
* package-lock out of sync ([6fe7d36](https://github.com/ike18t/ng-mocks/commit/6fe7d36))
<a name="7.0.0"></a>

@@ -409,2 +429,7 @@ # 7.0.0 (2018-10-26)

<a name="7.0.0"></a>
# 7.0.0 (2018-10-26)
<a name="6.3.0"></a>

@@ -601,2 +626,12 @@ # 6.3.0 (2018-10-17)

<a name="6.3.0"></a>
# 6.3.0 (2018-10-17)
### Features
* **MockDirective:** added the ability to use ViewChild/ViewChildren etc with MockDirective ([8853e87](https://github.com/ike18t/ng-mocks/commit/8853e87))
<a name="6.2.3"></a>

@@ -783,2 +818,12 @@ ## 6.2.3 (2018-10-02)

<a name="6.2.3"></a>
## 6.2.3 (2018-10-02)
### Bug Fixes
* **MockPlural:** removing generic type from MockComponents, Directives, and Pipes ([919a06c](https://github.com/ike18t/ng-mocks/commit/919a06c))
<a name="6.2.2"></a>

@@ -955,2 +1000,12 @@ ## 6.2.2 (2018-10-02)

<a name="6.2.2"></a>
## 6.2.2 (2018-10-02)
### Bug Fixes
* **MockModule:** Never mock CommonModule ([119dd80](https://github.com/ike18t/ng-mocks/commit/119dd80))
<a name="6.2.1"></a>

@@ -1117,2 +1172,7 @@ ## 6.2.1 (2018-08-28)

<a name="6.2.1"></a>
## 6.2.1 (2018-08-28)
<a name="6.2.0"></a>

@@ -1274,2 +1334,12 @@ # 6.2.0 (2018-08-28)

<a name="6.2.0"></a>
# 6.2.0 (2018-08-28)
### Features
* add a MockedComponent type ([fe547af](https://github.com/ike18t/ng-mocks/commit/fe547af))
<a name="6.1.0"></a>

@@ -1421,2 +1491,12 @@ # 6.1.0 (2018-06-04)

<a name="6.1.0"></a>
# 6.1.0 (2018-06-04)
### Features
* support structural directives ([050e70c](https://github.com/ike18t/ng-mocks/commit/050e70c))
<a name="6.0.1"></a>

@@ -1428,2 +1508,138 @@ ## 6.0.1 (2018-05-15)

* package json peer dep version range ([8ad3834](https://github.com/ike18t/ng-mocks/commit/8ad3834))
<a name="6.0.0"></a>
# 6.0.0 (2018-05-14)
### Features
* support angular 6 and test 5 & 6 in travis ([5bc9331](https://github.com/ike18t/ng-mocks/commit/5bc9331))
<a name="5.3.0"></a>
# 5.3.0 (2018-04-05)
### Features
* MockOf - Include mocked class names in mock class names ([8b149f5](https://github.com/ike18t/ng-mocks/commit/8b149f5))
<a name="5.2.0"></a>
# 5.2.0 (2018-03-30)
### Features
* Use Angular annotation resolvers ([4050d10](https://github.com/ike18t/ng-mocks/commit/4050d10))
<a name="5.1.0"></a>
# 5.1.0 (2018-03-25)
### Bug Fixes
* Add a null check for decorator args ([1058044](https://github.com/ike18t/ng-mocks/commit/1058044))
### Features
* Support Angular propDecorators inputs and outputs ([add374d](https://github.com/ike18t/ng-mocks/commit/add374d))
<a name="5.0.0"></a>
# 5.0.0 (2018-03-25)
### Bug Fixes
* Fix bad return value from mock-directive ([4659a32](https://github.com/ike18t/ng-mocks/commit/4659a32))
* multiple decorators on an input ([13874b9](https://github.com/ike18t/ng-mocks/commit/13874b9))
* Outdated package-lock ([7623e98](https://github.com/ike18t/ng-mocks/commit/7623e98))
### Features
* add functions to mass mock ([fee5a03](https://github.com/ike18t/ng-mocks/commit/fee5a03))
* Cleanup exports and export MockDeclaration from MockModule ([9fe2bb1](https://github.com/ike18t/ng-mocks/commit/9fe2bb1))
* mock directives now have event emitter bound outputs ([bac1ca5](https://github.com/ike18t/ng-mocks/commit/bac1ca5))
<a name="5.0.0-rc5"></a>
# 5.0.0-rc5 (2018-03-07)
### Bug Fixes
* package json typings location ([5f6fde0](https://github.com/ike18t/ng-mocks/commit/5f6fde0))
<a name="5.0.0-rc4"></a>
# 5.0.0-rc4 (2018-03-07)
<a name="5.0.0-rc3"></a>
# 5.0.0-rc3 (2018-03-07)
### Bug Fixes
* integrate mock-pipe ([d747517](https://github.com/ike18t/ng-mocks/commit/d747517))
* mock_direcive integration ([7f02f7b](https://github.com/ike18t/ng-mocks/commit/7f02f7b))
### Features
* merge in mock-module ([05eaebe](https://github.com/ike18t/ng-mocks/commit/05eaebe))
* support inputs and outputs from extended components ([fc46838](https://github.com/ike18t/ng-mocks/commit/fc46838))
<a name="5.0.0-rc1"></a>
# 5.0.0-rc1 (2018-02-10)
### Bug Fixes
* add reflect-metadata back to devDeps ([385c9c4](https://github.com/ike18t/ng-mocks/commit/385c9c4))
* Add support for directives with a different kind of meta ([0bd38cc](https://github.com/ike18t/ng-mocks/commit/0bd38cc))
* add testbed test that exposed now fixed issue ([610cbdc](https://github.com/ike18t/ng-mocks/commit/610cbdc))
* forgot how to use js reduce ([de518d4](https://github.com/ike18t/ng-mocks/commit/de518d4))
* instantiate event emitters in component constructor ([fb4b97d](https://github.com/ike18t/ng-mocks/commit/fb4b97d))
* module exports is now all declarations ([fbb0e73](https://github.com/ike18t/ng-mocks/commit/fbb0e73))
* output binding ([59f476d](https://github.com/ike18t/ng-mocks/commit/59f476d))
* works with component w/o inputs or outputs ([b3d38e7](https://github.com/ike18t/ng-mocks/commit/b3d38e7))
### Features
* add exportAs and alias support ([14a1474](https://github.com/ike18t/ng-mocks/commit/14a1474))
* add support for exportAs and input aliases ([9b42a21](https://github.com/ike18t/ng-mocks/commit/9b42a21))
* Adding angular 2 compatibility and moving to peerDependency ([#3](https://github.com/ike18t/ng-mocks/issues/3)) ([4bd93db](https://github.com/ike18t/ng-mocks/commit/4bd93db))
* component mock implements control value accessor to support ngModel binding ([67ea7c4](https://github.com/ike18t/ng-mocks/commit/67ea7c4))
* initial implementation ([893f83b](https://github.com/ike18t/ng-mocks/commit/893f83b))
* memoize function by arg ([031e3a6](https://github.com/ike18t/ng-mocks/commit/031e3a6))
* memoize function by arg ([cac00b3](https://github.com/ike18t/ng-mocks/commit/cac00b3))
* mock module providers ([49b2272](https://github.com/ike18t/ng-mocks/commit/49b2272))
* Upgrade to angular 5 and pull in testbed for tests ([7df64a8](https://github.com/ike18t/ng-mocks/commit/7df64a8))
<a name="6.0.1"></a>
## 6.0.1 (2018-05-15)
### Bug Fixes
* Fix peer dependencies

@@ -1430,0 +1646,0 @@

13

dist/lib/mock-component/mock-component.js

@@ -30,3 +30,11 @@ "use strict";

}
var _a = reflect_1.directiveResolver.resolve(component), exportAs = _a.exportAs, inputs = _a.inputs, outputs = _a.outputs, selector = _a.selector;
var _a = reflect_1.directiveResolver.resolve(component), exportAs = _a.exportAs, inputs = _a.inputs, outputs = _a.outputs, queries = _a.queries, selector = _a.selector;
var template = '<div data-key="ng-content"><ng-content></ng-content></div>';
if (queries) {
template += Object.keys(queries)
.map(function (key) {
var query = queries[key];
return "<div data-key=\"" + query.selector + "\"><template [ngTemplateOutlet]=\"" + key + "\"></template></div>";
}).join('');
}
var options = {

@@ -45,4 +53,5 @@ exportAs: exportAs,

}],
queries: queries,
selector: selector,
template: '<ng-content></ng-content>'
template: template,
};

@@ -49,0 +58,0 @@ var ComponentMock = (function () {

@@ -21,2 +21,3 @@ "use strict";

var simple_component_component_1 = require("./test-components/simple-component.component");
var template_outlet_component_1 = require("./test-components/template-outlet.component");
var ExampleComponentContainer = (function () {

@@ -36,3 +37,3 @@ function ExampleComponentContainer() {

selector: 'example-component-container',
template: "\n <simple-component [someInput]=\"'hi'\"\n [someOtherInput]=\"'bye'\"\n [someInput3]=true\n (someOutput1)=\"emitted = $event\"\n (someOutput2)=\"emitted = $event\">\n </simple-component>\n <simple-component [someInput]=\"'hi again'\" #f='seeimple'></simple-component>\n <empty-component></empty-component>\n <custom-form-control [formControl]=\"formControl\"></custom-form-control>\n <empty-component id=\"ng-content-component\">doh</empty-component>\n <empty-component id=\"ngmodel-component\" [(ngModel)]=\"someOutputHasEmitted\"></empty-component>\n <child-component></child-component>\n "
template: "\n <simple-component [someInput]=\"'hi'\"\n [someOtherInput]=\"'bye'\"\n [someInput3]=true\n (someOutput1)=\"emitted = $event\"\n (someOutput2)=\"emitted = $event\">\n </simple-component>\n <simple-component [someInput]=\"'hi again'\" #f='seeimple'></simple-component>\n <empty-component></empty-component>\n <custom-form-control [formControl]=\"formControl\"></custom-form-control>\n <empty-component id=\"ng-content-component\">doh</empty-component>\n <empty-component id=\"ngmodel-component\" [(ngModel)]=\"someOutputHasEmitted\"></empty-component>\n <child-component></child-component>\n <template-outlet-component>\n ng-content body header\n <ng-template #block1><div>block 1 body</div></ng-template>\n <ng-template #block2><span>block 2 body</span></ng-template>\n ng-content body footer\n </template-outlet-component>\n "
})

@@ -50,3 +51,3 @@ ], ExampleComponentContainer);

ExampleComponentContainer,
mock_component_1.MockComponents(empty_component_component_1.EmptyComponent, simple_component_component_1.SimpleComponent, child_component_component_1.ChildComponent, custom_form_control_component_1.CustomFormControlComponent),
mock_component_1.MockComponents(empty_component_component_1.EmptyComponent, simple_component_component_1.SimpleComponent, template_outlet_component_1.TemplateOutletComponent, child_component_component_1.ChildComponent, custom_form_control_component_1.CustomFormControlComponent),
],

@@ -148,3 +149,19 @@ imports: [

});
describe('NgTemplateOutlet', function () {
it('renders all @ContentChild properties and ngContent too', function () {
fixture.detectChanges();
var templateOutlet = fixture.debugElement.query(platform_browser_1.By.directive(mock_component_1.MockComponent(template_outlet_component_1.TemplateOutletComponent)));
expect(templateOutlet).toBeDefined();
var ngContent = templateOutlet.query(platform_browser_1.By.css('[data-key="ng-content"]'));
expect(ngContent).toBeTruthy();
expect(ngContent.nativeElement.innerText).toEqual('ng-content body header ng-content body footer');
var block1 = templateOutlet.query(platform_browser_1.By.css('[data-key="block1"]'));
expect(block1).toBeTruthy();
expect(block1.nativeElement.innerText.trim()).toEqual('block 1 body');
var block2 = templateOutlet.query(platform_browser_1.By.css('[data-key="block2"]'));
expect(block2).toBeTruthy();
expect(block2.nativeElement.innerText).toEqual('block 2 body');
});
});
});
//# sourceMappingURL=mock-component.spec.js.map

2

package.json
{
"name": "ng-mocks",
"version": "7.0.1",
"version": "7.1.0",
"description": "Functions for creating angular mocks",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc