Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-mock-record

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-mock-record - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

package.json
{
"name": "angular-mock-record",
"version": "1.1.0",
"version": "1.2.0",
"description": "An angular / protractor framework that mocks and records requests. Requests can be manually mocked or recorded like VCR.",

@@ -5,0 +5,0 @@ "main": "server.js",

# angular-mock-record
An angular 4+ framework that mocks and records requests. Requests can be manually mocked or recorded like VCR.
An Angular 4+ framework that mocks and records requests. Requests can be manually mocked or recorded like VCR.

@@ -35,3 +35,3 @@ # Installation

- Then mock requests in beforeEach or beforeAll:
- Then, mock requests in beforeEach or beforeAll:

@@ -45,3 +45,3 @@

- Next run tests in the describe block:
- Next, run tests in the describe block:

@@ -63,1 +63,13 @@

`
# Setting up mock.record.config.json for recording
- Set `domain` as the request path that will be used to make requests and record.
- Set an array of params that need to be excluded from request url matching via `exclude_params`. Ex: `exclude_params: ['sort']`
- Set an array of params that need to be normalized in request url via `normalize_params`. Ex: `normalize_params: ['randomly_generated_id']`
- Set `allow_recording` to true to fail when a new recording is detected. This is handy for continuous integration tools such as Travis CI.
# Running the server
- Run `node ./node_modules/angular-mock-record/server/server.js allow_recording`
- Hit `http://localhost:<port>/<api_path>` in a browser to test the recording functionality. Once recorded, requests matching this URL will return the captured recording.
- Finally, set up your application's E2E endpoint configuration to point to `http://localhost:<port>/<api_path>`. Start the server, then run `ng e2e`. All requests will be recorded unless they are otherwise mocked.

@@ -54,3 +54,3 @@ const Http = require('./http.js');

if (!this.recordingAllowed()) {
console.error('\nAn unrecorded request was detected\n');
console.error('\nAn unrecorded request was detected:\n' + req.url);
console.error('\nTo record new requests, use the `allow_recording` parameter\n');

@@ -57,0 +57,0 @@ process.exit(1);

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