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
2
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 13.5.1 to 13.5.2

13

examples/TestHttpInterceptor/test.spec.ts

@@ -21,2 +21,3 @@ import {

NG_MOCKS_INTERCEPTORS,
ngMocks,
} from 'ng-mocks';

@@ -96,9 +97,9 @@

it('triggers interceptor', () => {
const fixture = MockRender('');
const client: HttpClient =
fixture.debugElement.injector.get(HttpClient);
const httpMock: HttpTestingController =
fixture.debugElement.injector.get(HttpTestingController);
MockRender();
// Let's do a simply request.
// Let's extract the service and http controller for testing.
const client = ngMocks.findInstance(HttpClient);
const httpMock = ngMocks.findInstance(HttpTestingController);
// Let's do a simple request.
client.get('/target').subscribe();

@@ -105,0 +106,0 @@

@@ -9,3 +9,3 @@ import { HttpClient, HttpClientModule } from '@angular/common/http';

import { MockBuilder, MockRender } from 'ng-mocks';
import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';

@@ -43,8 +43,7 @@ // A service that does http requests.

it('sends a request', () => {
const fixture = MockRender('');
MockRender();
// Let's extract the service and http controller for testing.
const service: TargetService =
fixture.debugElement.injector.get(TargetService);
const httpMock: HttpTestingController =
fixture.debugElement.injector.get(HttpTestingController);
const service = ngMocks.findInstance(TargetService);
const httpMock = ngMocks.findInstance(HttpTestingController);

@@ -51,0 +50,0 @@ // A simple subscription to check what the service returns.

@@ -103,3 +103,3 @@ import { TestBed } from '@angular/core/testing';

// By default nothing should be initialized.
// By default, nothing should be initialized.
expect(service.onChanges).toHaveBeenCalledTimes(0);

@@ -106,0 +106,0 @@

{
"name": "ng-mocks",
"version": "13.5.1",
"version": "13.5.2",
"description": "An Angular testing library for creating mock services, components, directives, pipes and modules in unit tests, which includes shallow rendering, precise stubs to dump child dependencies, supports Angular 5 6 7 8 9 10 11 12 13, jasmine and jest.",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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