Skip to content

Commit

Permalink
fix tests (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
berndfuhrmann authored Sep 27, 2024
1 parent ff998e7 commit fb8383e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
21 changes: 10 additions & 11 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('TransportStream', () => {
})
});

expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});

it('should not log when no info object is provided', done => {
Expand All @@ -100,7 +100,7 @@ describe('TransportStream', () => {
})
});

expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});

it('should only log messages BELOW the level priority', done => {
Expand All @@ -119,7 +119,7 @@ describe('TransportStream', () => {
});

transport.levels = testLevels;
expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});

it('{ level } should be ignored when { handleExceptions: true }', () => {
Expand All @@ -139,7 +139,7 @@ describe('TransportStream', () => {
});

transport.levels = testLevels;
expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});

describe('when { exception: true } in info', () => {
Expand All @@ -163,7 +163,7 @@ describe('TransportStream', () => {
}
});

expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});

it('should invoke log when { handleExceptions: true }', done => {
Expand All @@ -190,8 +190,7 @@ describe('TransportStream', () => {
next();
}
});

expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});
});
});
Expand Down Expand Up @@ -223,7 +222,7 @@ describe('TransportStream', () => {
};

transport.cork();
expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
transport.uncork();
});

Expand Down Expand Up @@ -263,7 +262,7 @@ describe('TransportStream', () => {
};

transport.cork();
expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
transport.uncork();
});

Expand Down Expand Up @@ -294,7 +293,7 @@ describe('TransportStream', () => {
};

transport.cork();
expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
transport.uncork();
});

Expand Down Expand Up @@ -324,7 +323,7 @@ describe('TransportStream', () => {

transport.cork();
transport.levels = testLevels;
expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
transport.uncork();
});
});
Expand Down
13 changes: 6 additions & 7 deletions test/legacy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('LegacyTransportStream', () => {
done();
}));

expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});

it('should only log messages BELOW the level priority', done => {
Expand All @@ -126,7 +126,7 @@ describe('LegacyTransportStream', () => {
}));

transport.levels = testLevels;
expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});

it('{ level } should be ignored when { handleExceptions: true }', () => {
Expand All @@ -147,7 +147,7 @@ describe('LegacyTransportStream', () => {
}));

transport.levels = testLevels;
expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});

describe('when { exception: true } in info', () => {
Expand All @@ -169,7 +169,7 @@ describe('LegacyTransportStream', () => {
done();
});

expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});

it('should invoke log when { handleExceptions: true }', done => {
Expand Down Expand Up @@ -197,8 +197,7 @@ describe('LegacyTransportStream', () => {
return done();
}
});

expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
});
});
});
Expand Down Expand Up @@ -228,7 +227,7 @@ describe('LegacyTransportStream', () => {
};

transport.cork();
expected.forEach(transport.write.bind(transport));
expected.forEach(entry => transport.write.bind(transport)(entry));
transport.uncork();
});
});
Expand Down

0 comments on commit fb8383e

Please sign in to comment.