
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
component-mock
Advanced tools
A wrapper for deku components to facilitate easier unit-testing.
var Mock = require('component-mock');
var Component = {
defaultProps: {
name: 'a'
},
render: function ({ props }) {
return <div>{props.name}</div>;
}
}
var mock = Mock(Component);
var node = mock.render();
assert.isNode(node, 'div');
assert.hasChildren(node, [ 'a' ]);
var node = mock.render({ props: { name: 'b' } });
assert.isNode(node, 'div');
assert.hasChildren(node, [ 'b' ]);
Returns a wrapper object for the Component. The goal is that there will be
many methods that reflect various lifecycle events for the deku component.
Currently, we only deal with render, but others will be added over time as
we develop good testing strategies.
Calls Component.render(). The render function will have all the parameters
it would normally expect generated automatically. (eg: props,
props.children and state)
This also uses Component.defaultProps and Component.initialState() to ensure
the component object is generated accurately.
The setState function that is passed is simply a no-op, it won't trigger any
other changes. (as it shouldn't, since this is designed for unit-testing)
FAQs
> A wrapper for deku components to facilitate easier unit-testing.
The npm package component-mock receives a total of 16 weekly downloads. As such, component-mock popularity was classified as not popular.
We found that component-mock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.