# Mockoso ``` new Mockoso({ // config options overwrite_contracts, {boolean} }) const start = () { nock.disableNetConnect(); nock.load(nocksPath); if (opts.rec) nock.recorder.rec({ output_objects: true, }) } const stop = () { if (opts.rec) const nockCallObjects = nock.recorder.play() // store nockCallObjects in contracts-registry nock.cleanAll(); } mockoso = { start, stop, } ``` ## Luego en los MS: ### Install 1. npm i mockoso 2. agregar script para correr los tests de integración `mockoso: mocha --file setup.js ./integration-tests --recursive` 3. agregar `/integration-tests` folder with `setup.js`: ``` const Mockoso = require('mockoso'); // pasar config acá ? const mockoso = new Mockoso(); before(function () { mockoso.start(); }); after(function () { mockoso.stop(); }); ``` ### Usage Para correr los tests: ``` npm run mockoso <option> where <option>: --rec generate contracts automagically --register ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up