Skip to content

Commit 5f9a2f8

Browse files
committed
Updated tests to get result properly
1 parent 192c6ff commit 5f9a2f8

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/v1/result.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class Result {
5454
let observer = {
5555
onNext: (record) => { records.push(record); },
5656
onCompleted: (summary) => {
57-
resolve({records, summary});
57+
records.summary = summary;
58+
resolve(records);
5859
},
5960
onError: (error) => { reject(error); }
6061
};

test/v1/tck/steps/steps.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,17 @@ module.exports = function () {
129129
this.Then(/^the result returned from the server should be a single record with a single value$/, function (callback) {
130130
var self = this;
131131
this.setWithParam.then( function(res) {
132-
if(res.records.length != 1 || tempSizeOfObject(res.records[0]) != 1) {
133-
callback(new Error("Expected the parameterized statement to return a single row, single field record. Got: " + res));
132+
if(Object.keys(res[0]).length != 1 || Object.keys(res[0])[0].length != 1) {
133+
callback(new Error("Expected the parameterized statement to return a single row, single field record. Got: " + Object.keys(res[0]).length + " records and: " + Object.keys(res[0])[0].length + " values"));
134134
} else {
135-
self.paramResult = res.records[0]['x'];
135+
self.paramResult = res[0]['x'];
136136
}
137137
}, function(err) {callback(new Error("Rejected Promise: " + err))});
138138
this.setWithLiteral.then( function(res) {
139-
if(res.records.length != 1 || tempSizeOfObject(res.records[0]) != 1) {
140-
callback(new Error("Expected the literal statement to return a single row, single field record. Got: " + res));
139+
if(Object.keys(res[0]).length != 1 || Object.keys(res[0])[0].length != 1) {
140+
callback(new Error("Expected the parameterized statement to return a single row, single field record. Got: " + Object.keys(res[0]).length + " records and: " + Object.keys(res[0])[0].length + " values"));
141141
} else {
142-
self.literalResult = res.records[0]['x'];
142+
self.literalResult = res[0]['x'];
143143
callback();
144144
}
145145
}, function(err) {callback(new Error("Rejected Promise: " + err))});

0 commit comments

Comments
 (0)