
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
angular-mock-record
Advanced tools
An angular / protractor 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.
npm install angular-mock-record
mock.record.config.json
file in the root of your Angular app:{
"domain": "http://your.api.domain",
"port": 3000,
"cors": false,
"tape_name": "vcr",
"proxied_mock_server_route": "/e2e",
"request_headers": [
"X-XSRF-TOKEN",
"cookie"
],
"recording_dir": "./e2e/mocks",
"allow_recording": false,
"exclude_params": [],
"normalize_params": []
}
import { MockUtilities } from 'angular-mock-record/client/mock.utilities';
beforeAll(() => { mockUtilities.mockRequest('path/yourRequest.json', {foo: 'bar'}); )};
it('should have the mocked request data', () => { expect(page.getFoo().getText()).toContain('bar'); });
afterAll(() => { mockUtilities.clearMocks(); });
domain
as the request path that will be used to make requests and record.exclude_params
. Ex: exclude_params: ['sort']
normalize_params
. Ex: normalize_params: ['randomly_generated_id']
allow_recording
to true to fail when a new recording is detected. This is handy for continuous integration tools such as Travis CI.node ./node_modules/angular-mock-record/server/server.js allow_recording
http://localhost:<port>/<api_path>
in a browser to test the recording functionality. Once recorded, requests matching this URL will return the captured recording.http://localhost:<port>/<api_path>
. Start the server, then run ng e2e
. All requests will be recorded unless they are otherwise mocked.FAQs
An angular / protractor framework that mocks and records requests. Requests can be manually mocked or recorded like VCR.
The npm package angular-mock-record receives a total of 1 weekly downloads. As such, angular-mock-record popularity was classified as not popular.
We found that angular-mock-record demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.