Use JSON.stringify instead of toString
This commit is contained in:
1 parent
05e448c4c5
commit
9fe2de8969
1 file changed
+1
-1
@@ -187,7 +187,7 @@ class NetworkService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let match;
|
let match;
|
||||||
result = result.toString();
|
result = typeof result === "object" ? JSON.stringify(result) : result.toString();
|
||||||
if (matchMethod === "include") match = result.includes(expectedValue);
|
if (matchMethod === "include") match = result.includes(expectedValue);
|
||||||
else if (matchMethod === "regex") match = new RegExp(expectedValue).test(result);
|
else if (matchMethod === "regex") match = new RegExp(expectedValue).test(result);
|
||||||
else match = result === expectedValue;
|
else match = result === expectedValue;
|
||||||
|
|||||||
Reference in new issue
Block a user