Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
test: asserts feature snippet and parsed data in "data_model" tests
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-zakharchenko committed Jun 17, 2019
1 parent 4ae30f5 commit 2495cdd
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions test/cucumber/step_definitions/model_steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,20 @@ module.exports = function() {
return this.Then(
/^"([^"]*)" JSON representation will look like this:$/,
function(objectTypeString, string, callback) {
let data, klass;
let data;
const expectedObject = JSON.parse(string);

if (objectTypeString === 'HTTP Request') {
klass = 'HttpRequest';
data = this.model.request;
} else if (objectTypeString === 'HTTP Response') {
klass = 'HttpResponse';
data = this.model.response;
} else if (objectTypeString === 'Expected HTTP Request') {
klass = 'ExpectedHttpRequest';
data = this.expected;
} else if (objectTypeString === 'Expected HTTP Response') {
klass = 'ExpectedHttpResponse';
data = this.expected;
}

const instance = new gavel[klass](data);

const jsonizedInstance = JSON.parse(JSON.stringify(instance));
const jsonizedInstance = JSON.parse(JSON.stringify(data));

if (!deepEqual(expectedObject, jsonizedInstance, { strict: true })) {
callback(
Expand Down

0 comments on commit 2495cdd

Please sign in to comment.