Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Forgery is a set of testing tools for Node.js and client-side MVC applications. Specifically it's designed to integrate well with popular testing frameworks like:
To install the latest stable version of Forgery, use npm with the following command:
npm install forgery
Forgery.Factory
is a JSON fixtures library for Node.js. It is usful for
stubbing out API responses and creating JSON unique JSON objects for testing.
Forgery's Factory functionality is heavily inspired by Factory Girl. In order to use it, all you have to do is require it and define some factories. For example:
var Factory = require('forgery').Factory;
Factory.define('MyFactory', {
"foo": "bar",
});
... etc ...
Now when ever you need to create a new factory, you have access to it through
the Factory
method:
Factory('MyFactory')
//=> { id: '9e55f9ad9411aea49d554ae4e0b5c306', foo:'bar' }
We can also easily override the default attributes by passing in an options hash as a second parameter.
Factory('MyFactory', { foo: 'tab' })
//=> { id: '9e55f9ad9411aea49d554ae4e0b5c306', foo:'tab' }
Sometimes you will want the ID field to have a different format. For instance,
if you are mocking Mongo objects, they have an _id
attribute instead. You
can specify to use a differnt ID field or none at all using the third parameter.
// Alternative ID field
Factory('MyFactory', { foo: 'tab' }, { idField: '_id' })
//=> { _id: '9e55f9ad9411aea49d554ae4e0b5c306', foo:'tab' }
// No ID field (must set explicitly to false
Factory('MyFactory', { foo: 'tab' }, { idField: false })
//=> { foo:'tab' }
WARNING: Forgery is under heavy development and will not be subject to
semantic versioning standards until version 0.0.1
. Please be aware that API
changes may occur in the mean time.
Copyright (C) 2012 Mike Swift
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
FAQs
A set of testing tools for Node and MVC apps.
We found that forgery 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.