How would one test the received response data from a function equals the contents of a .json file?
For example: I have a function that will fill in some json fields with the values passed to it, and I am wanting to test that this of course works correctly.
What I am thinking...
var firstName: string = 'Jim';
var lastName: string = 'Ross';
var jsonDataMaker: any = service.jsonifyData(firstName, lastName);
const expectedJson = require('./expectedJson.json');
expect(jsonDataMaker).toBe(expectedJson);
Any pointers would be great :-)
Aucun commentaire:
Enregistrer un commentaire