Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
leonardojs
Advanced tools
Leonardo - Your mocking ninja - an add-on tool for centralizing your client side mocking
$ npm install leonardojs --save-dev
Video Example - AngularJS Israel Conference (Hebrew)
// in dev environment
import 'leonardojs';
<!DOCTYPE HTML>
<html>
<body>
//.....
<script src="[node_modules|other]/leonardo/dist/leonardo.js"></script>
</body>
</html>
You should now see Leonardo's icon on the bottom right corner. Click It.
Automate your mocks using Leonardo's API
State:
StateOption:
addState(State array)
//.....
Leonardo.addStates([
{
name: 'Get Data',
url: '/api/user/43435',
verb: 'GET',
options: [
{name: 'success', status: 200, data: { name: "Master Splinter" }},
{name: 'error 500', status: 500}
]
},{
name: 'Get Data',
url: '/api/user/43435',
verb: 'GET',
options: [
{name: 'success', status: 200, data: { name: "Master Splinter" }},
{name: 'error 500', status: 500}
]
},
{
name: 'Get Characters',
url: '/api/character',
verb: 'GET',
options: [
{
name: 'success',
status: 200,
data: function(request) {
if (request.url.indexOf('term=Donatello') > 0) {
return { name: "Donatello" };
} else {
return { name: "Raphael" };
}
}
},
]
}
]);
activateStateOption(stateName, optionName)
Activates state option, mocked response will be returned when calling the state url
//.....
Leonardo.activateStateOption('Update Data', 'success');
$http.put('/api/user/43435', { name: "Master Splinter" }).success(function(data, status) {
console.log(status); // 200
});
Leonardo.activateStateOption('Update Data', 'error 500');
$http.put('/api/user/43435', { name: "Master Splinter" }).error(function(data, status) {
console.log(status); // 500
});
//.....
deactivateState(stateName)
Deactivates a specific state, when calling the state url request will pass through to the server
//.....
Leonardo.deactivateState('Update Data');
//.....
You can hide Leonardo activator icon by clicking ctrl
+ shift
+ l
.
FAQs
Leonardo - Your mocking ninja - an add-on tool for centralizing your client side mocking
We found that leonardojs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.