2.0.3 • Published 10 years ago
rock-solid v2.0.3
##What: Rock solid is a library that adds data driven testing capabilities to BDD style testing frameworks like Jasmine, Mocha etc
##Install:
npm install rock-solid
##Usage: import the keyword you need
#using:
Used to execute a it or describe block repetitively with different input data and expected results for each data set
import {using} from 'rock-solid'Wrap either a
describeoritblock in ausingblock:
using([{
input: 'monkey',
expectedResult: 'I R Baboon'
}], function(animal, expectedSound){
describe(`when the animal is a ${input} and makeSound() is called`, function() {
it(`it should make the sound ${expectedResult}`, function() {
let actualSound = makeSound();
expect(actualSound).toEqual(expectedSound);
});
});
});##Credits:
1. JP Castro from Lyon, France: The guy that got me started on this with this blog