---
# System prepended metadata

title: Mockoso

---

# 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
```