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 6.0.1 to 6.1.0

141

CHANGELOG.md

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

<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>

@@ -12,17 +22,115 @@ ## 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))
* Fix bad return value from mock-directive ([4659a32](https://github.com/ike18t/ng-mocks/commit/4659a32))
* 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))
* integrate mock-pipe ([d747517](https://github.com/ike18t/ng-mocks/commit/d747517))
* mock_direcive integration ([7f02f7b](https://github.com/ike18t/ng-mocks/commit/7f02f7b))
* module exports is now all declarations ([fbb0e73](https://github.com/ike18t/ng-mocks/commit/fbb0e73))
* 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))
* output binding ([59f476d](https://github.com/ike18t/ng-mocks/commit/59f476d))
* package json peer dep version range ([8ad3834](https://github.com/ike18t/ng-mocks/commit/8ad3834))
* package json typings location ([5f6fde0](https://github.com/ike18t/ng-mocks/commit/5f6fde0))
* works with component w/o inputs or outputs ([b3d38e7](https://github.com/ike18t/ng-mocks/commit/b3d38e7))

@@ -34,6 +142,4 @@

* add exportAs and alias support ([14a1474](https://github.com/ike18t/ng-mocks/commit/14a1474))
* add functions to mass mock ([fee5a03](https://github.com/ike18t/ng-mocks/commit/fee5a03))
* 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))
* Cleanup exports and export MockDeclaration from MockModule ([9fe2bb1](https://github.com/ike18t/ng-mocks/commit/9fe2bb1))
* component mock implements control value accessor to support ngModel binding ([67ea7c4](https://github.com/ike18t/ng-mocks/commit/67ea7c4))

@@ -43,14 +149,17 @@ * initial implementation ([893f83b](https://github.com/ike18t/ng-mocks/commit/893f83b))

* memoize function by arg ([cac00b3](https://github.com/ike18t/ng-mocks/commit/cac00b3))
* merge in mock-module ([05eaebe](https://github.com/ike18t/ng-mocks/commit/05eaebe))
* mock directives now have event emitter bound outputs ([bac1ca5](https://github.com/ike18t/ng-mocks/commit/bac1ca5))
* mock module providers ([49b2272](https://github.com/ike18t/ng-mocks/commit/49b2272))
* MockOf - Include mocked class names in mock class names ([8b149f5](https://github.com/ike18t/ng-mocks/commit/8b149f5))
* support angular 6 and test 5 & 6 in travis ([5bc9331](https://github.com/ike18t/ng-mocks/commit/5bc9331))
* Support Angular propDecorators inputs and outputs ([add374d](https://github.com/ike18t/ng-mocks/commit/add374d))
* support inputs and outputs from extended components ([fc46838](https://github.com/ike18t/ng-mocks/commit/fc46838))
* Upgrade to angular 5 and pull in testbed for tests ([7df64a8](https://github.com/ike18t/ng-mocks/commit/7df64a8))
* Use Angular annotation resolvers ([4050d10](https://github.com/ike18t/ng-mocks/commit/4050d10))
<a name="6.0.1"></a>
## 6.0.1 (2018-05-15)
### Bug Fixes
* Fix peer dependencies
<a name="6.0.0"></a>

@@ -57,0 +166,0 @@ # 6.0.0 (2018-05-14)

22

dist/lib/mock-directive/mock-directive.js

@@ -11,2 +11,5 @@ "use strict";

};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -31,21 +34,26 @@ var core_1 = require("@angular/core");

var _a = reflect_1.directiveResolver.resolve(directive), selector = _a.selector, exportAs = _a.exportAs, inputs = _a.inputs, outputs = _a.outputs;
var options = { exportAs: exportAs, inputs: inputs, outputs: outputs, selector: selector };
var DirectiveMock = (function () {
function DirectiveMock() {
function DirectiveMock(templateRef, viewContainer) {
var _this = this;
(options.outputs || []).forEach(function (output) {
(outputs || []).forEach(function (output) {
_this[output.split(':')[0]] = new core_1.EventEmitter();
});
if (templateRef && viewContainer) {
viewContainer.createEmbeddedView(templateRef);
}
}
DirectiveMock = __decorate([
common_1.MockOf(directive),
__metadata("design:paramtypes", [])
core_1.Directive({ exportAs: exportAs, inputs: inputs, outputs: outputs, selector: selector }),
__param(0, core_1.Optional()), __param(0, core_1.Inject(core_1.TemplateRef)),
__param(1, core_1.Optional()), __param(1, core_1.Inject(core_1.ViewContainerRef)),
__metadata("design:paramtypes", [core_1.TemplateRef,
core_1.ViewContainerRef])
], DirectiveMock);
return DirectiveMock;
}());
var mockedDirective = core_1.Directive(options)(DirectiveMock);
cache.set(directive, mockedDirective);
return mockedDirective;
cache.set(directive, DirectiveMock);
return DirectiveMock;
}
exports.MockDirective = MockDirective;
//# sourceMappingURL=mock-directive.js.map

@@ -8,2 +8,5 @@ import { EventEmitter } from '@angular/core';

}
export declare class ExampleStructuralDirective {
exampleStructuralDirective: boolean;
}
export declare class ExampleComponentContainer {

@@ -10,0 +13,0 @@ emitted: boolean;

@@ -42,2 +42,18 @@ "use strict";

exports.ExampleDirective = ExampleDirective;
var ExampleStructuralDirective = (function () {
function ExampleStructuralDirective() {
this.exampleStructuralDirective = true;
}
__decorate([
core_1.Input(),
__metadata("design:type", Object)
], ExampleStructuralDirective.prototype, "exampleStructuralDirective", void 0);
ExampleStructuralDirective = __decorate([
core_1.Directive({
selector: '[exampleStructuralDirective]'
})
], ExampleStructuralDirective);
return ExampleStructuralDirective;
}());
exports.ExampleStructuralDirective = ExampleStructuralDirective;
var ExampleComponentContainer = (function () {

@@ -51,3 +67,3 @@ function ExampleComponentContainer() {

selector: 'example-component-container',
template: "\n <div [exampleDirective]=\"'bye'\" [bah]=\"'hi'\" #f=\"foo\" (someOutput)=\"emitted = $event\"></div>\n <div exampleDirective></div>\n <input [formControl]=\"fooControl\"/>\n "
template: "\n <div [exampleDirective]=\"'bye'\" [bah]=\"'hi'\" #f=\"foo\" (someOutput)=\"emitted = $event\"></div>\n <div exampleDirective></div>\n <div id=\"example-structural-directive\" *exampleStructuralDirective=\"true\">\n hi\n </div>\n <input [formControl]=\"fooControl\"/>\n "
})

@@ -65,3 +81,4 @@ ], ExampleComponentContainer);

mock_directive_1.MockDirective(forms_1.FormControlDirective),
mock_directive_1.MockDirective(ExampleDirective)
mock_directive_1.MockDirective(ExampleDirective),
mock_directive_1.MockDirective(ExampleStructuralDirective)
]

@@ -99,3 +116,7 @@ })

});
it('should display structural directive content', function () {
var debugElement = fixture.debugElement.query(platform_browser_1.By.css('#example-structural-directive'));
expect(debugElement.nativeElement.innerHTML).toContain('hi');
});
});
//# sourceMappingURL=mock-directive.spec.js.map
{
"name": "ng-mocks",
"version": "6.0.1",
"version": "6.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