Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
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 8 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.