fix logging browser tests (#1940)
This commit is contained in:
parent
3136e5b05f
commit
71be5bf637
|
|
@ -75,6 +75,7 @@ describe("connection", () => {
|
||||||
|
|
||||||
// DON'T use commonOptions because we want to specifically test the scenario where logMessageContent is not set.
|
// DON'T use commonOptions because we want to specifically test the scenario where logMessageContent is not set.
|
||||||
const connection = new HttpConnection("echo", {
|
const connection = new HttpConnection("echo", {
|
||||||
|
logger: TestLogger.instance,
|
||||||
transport: transportType,
|
transport: transportType,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -86,6 +87,7 @@ describe("connection", () => {
|
||||||
|
|
||||||
connection.onclose = (error) => {
|
connection.onclose = (error) => {
|
||||||
// Search the logs for the message content
|
// Search the logs for the message content
|
||||||
|
expect(TestLogger.instance.currentLog.messages.length).toBeGreaterThan(0);
|
||||||
for (const [_, logMessage] of TestLogger.instance.currentLog.messages) {
|
for (const [_, logMessage] of TestLogger.instance.currentLog.messages) {
|
||||||
expect(logMessage).not.toContain(message);
|
expect(logMessage).not.toContain(message);
|
||||||
}
|
}
|
||||||
|
|
@ -119,6 +121,7 @@ describe("connection", () => {
|
||||||
connection.onclose = (error) => {
|
connection.onclose = (error) => {
|
||||||
// Search the logs for the message content
|
// Search the logs for the message content
|
||||||
let matches = 0;
|
let matches = 0;
|
||||||
|
expect(TestLogger.instance.currentLog.messages.length).toBeGreaterThan(0);
|
||||||
for (const [_, logMessage] of TestLogger.instance.currentLog.messages) {
|
for (const [_, logMessage] of TestLogger.instance.currentLog.messages) {
|
||||||
if (logMessage.indexOf(message) !== -1) {
|
if (logMessage.indexOf(message) !== -1) {
|
||||||
matches += 1;
|
matches += 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue