Skip to content

simon-begin/js-jabstract

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Javascript version of jabstract

USAGE

Declare your json responses somewhere:

const jabstract = require('jabstract');

let apiResponse = jabstract({
    ... json-ish payload ...
});

Then use it in your tests by defining only relevant fields:

let response = apiResponse({
  'key': 'value'  
});

It even supports complex payloads!

let apiResponse = jabstract({
  'client': {
    'name': 'John doe',
    'email': '[email protected]'
  }
});

let response = apiResponse({
  'client': {
    'name': 'Baboon v2.0'
  }
});

* note that apiResponse will keep its default value. So you can mock multiple fixtures for the same payload

About

Test tool for overridable json fixtures in JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%