mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
fix timing issue in weather tests => returning response by url instead of index
This commit is contained in:
4
tests/node_modules/webdriverajaxstub/index.js
generated
vendored
4
tests/node_modules/webdriverajaxstub/index.js
generated
vendored
@@ -3,7 +3,7 @@ function plugin (wdInstance, requests) {
|
||||
throw new Error("You can't use WebdriverAjaxStub with this version of WebdriverIO");
|
||||
}
|
||||
|
||||
function stub(requests, done) {
|
||||
function stub({template, data}, done) {
|
||||
window.XMLHttpRequest = function () {
|
||||
this.open = function (method, url) {
|
||||
this.method = method;
|
||||
@@ -13,7 +13,7 @@ function plugin (wdInstance, requests) {
|
||||
this.send = function () {
|
||||
this.status = 200;
|
||||
this.readyState = 4;
|
||||
const response = requests.shift() || [];
|
||||
const response = this.url.includes('.njk') ? template : data;
|
||||
this.response = response;
|
||||
this.responseText = response;
|
||||
this.onreadystatechange();
|
||||
|
Reference in New Issue
Block a user