
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
leonardojs
Advanced tools
npm
$ npm install leonardojs
bower
$ bower install leonardo
<!DOCTYPE HTML>
<html>
<body>
//.....
<script src="[bower_componenets|node_modules|other]/leonardo/dist/leonardo.js"></script>
</body>
</html>
** If your app is running angularjs 1.x you will also need to add the Leonardo module as a dependency
<!DOCTYPE HTML>
<html>
<body ng-app="app">
//.....
<script>
var myApp = angular.module("app", ["leonardo"]);
//.....
</script>
</body>
</html>
You should now see Leonardo's icon on the bottom left corner. Start mocking your ajax calls by using the UI or the API
//.....
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: 'error 401', status: 401}
]
},
{
name: 'Update Data',
url: '/api/user/43435',
verb: 'PUT',
options: [
{name: 'success', status: 200},
{name: 'error 500', status: 500},
{name: 'error 400', status: 400}
]
}
]);
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
});
//.....
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
.
cd
into the project folder
npm install
gulp build
gulp serve
This will run the demo app (and auto-refresh the browser)
Copyright © 2015 MIT License
FAQs
Leonardo - Your mocking ninja - an add-on tool for centralizing your client side mocking
The npm package leonardojs receives a total of 19 weekly downloads. As such, leonardojs popularity was classified as not popular.
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.