segmentio/integration-tester — pull request #20 by yields (2014-08-12 09:59:33+00:00)
Title: Query

this allows you to pass `parse` function for each key, to allow less verbose testing.

so this:
```js
it('should map screen calls correctly', function(done){
var screen = {
name: 'name',
timestamp: new Date()
};
var event = JSON.stringify({
time: screen.timestamp.getTime(),
user_properties: {},
event_type: 'Viewed name Screen',
event_properties: {
name: 'name'
}
});

test
.set(settings)
.screen(screen)
.query({
api_key: settings.apiKey,
event: event
})
.expects(200, done);
});
```

becomes (note the `JSON.parse`.)

```js
it('should map screen calls correctly', function(done){
var json = test.fixture('screen-basic');
test
.set(settings)
.screen(json.input)
.query('api_key', settings.apiKey)
.query('event', json.output, JSON.parse)
.expects(200, done);
});
```