Skip to content

Commit 690d078

Browse files
author
Christian Jeschke
committed
getting closer to reality - data is received as string in data property
1 parent f432ac2 commit 690d078

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/angular-websocket-mock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
if (existingMocks[url]) {
117117
existingMocks[url].map(function (socketMock) {
118118
if (socketMock.onmessage && typeof socketMock.onmessage === "function") {
119-
socketMock.onmessage(data);
119+
socketMock.onmessage({ data: JSON.stringify(data) });
120120
}
121121
});
122122
}

src/angular-websocket-mock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function $WebSocketBackend() {
9696
if(existingMocks[url]) {
9797
existingMocks[url].map(function(socketMock) {
9898
if(socketMock.onmessage && typeof socketMock.onmessage === "function") {
99-
socketMock.onmessage(data);
99+
socketMock.onmessage({data: JSON.stringify(data)});
100100
}
101101
});
102102
}

0 commit comments

Comments
 (0)