Skip to content

Commit bf56f33

Browse files
authored
Fix CI issues (#1044)
* test: update node dependencies to fix test failures * test: update tests for async send
1 parent 87484fb commit bf56f33

File tree

2 files changed

+59
-21
lines changed

2 files changed

+59
-21
lines changed

package-lock.json

+29-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/browser.rollbar.test.js

+30-20
Original file line numberDiff line numberDiff line change
@@ -1495,17 +1495,21 @@ describe('options.autoInstrument', function() {
14951495
if(xhr.readyState === 4) {
14961496
try {
14971497
setTimeout(function() {
1498-
server.respond();
1498+
try {
1499+
server.respond();
14991500

1500-
expect(server.requests.length).to.eql(2);
1501-
var body = JSON.parse(server.requests[1].requestBody);
1501+
expect(server.requests.length).to.eql(2);
1502+
var body = JSON.parse(server.requests[1].requestBody);
15021503

1503-
expect(body.data.body.trace.exception.message).to.eql('HTTP request failed with Status 404');
1504+
expect(body.data.body.trace.exception.message).to.eql('HTTP request failed with Status 404');
15041505

1505-
// Just knowing a stack is present is enough for this test.
1506-
expect(body.data.body.trace.frames.length).to.be.above(1);
1506+
// Just knowing a stack is present is enough for this test.
1507+
expect(body.data.body.trace.frames.length).to.be.above(1);
15071508

1508-
done();
1509+
done();
1510+
} catch (e) {
1511+
done(e);
1512+
}
15091513
}, 1);
15101514
} catch (e) {
15111515
done(e);
@@ -1703,24 +1707,30 @@ describe('options.autoInstrument', function() {
17031707
.then(function(response) {
17041708
try {
17051709
rollbar.log('test'); // generate a payload to inspect
1706-
server.respond();
1710+
setTimeout(function() {
1711+
try {
1712+
server.respond();
17071713

1708-
expect(server.requests.length).to.eql(1);
1709-
var body = JSON.parse(server.requests[0].requestBody);
1714+
expect(server.requests.length).to.eql(1);
1715+
var body = JSON.parse(server.requests[0].requestBody);
17101716

1711-
// Verify request headers capture and case-insensitive scrubbing
1712-
expect(body.data.body.telemetry[0].body.request_headers).to.eql({'content-type': 'application/json', secret: '********'});
1717+
// Verify request headers capture and case-insensitive scrubbing
1718+
expect(body.data.body.telemetry[0].body.request_headers).to.eql({'content-type': 'application/json', secret: '********'});
17131719

1714-
// Verify response headers capture and case-insensitive scrubbing
1715-
expect(body.data.body.telemetry[0].body.response.headers).to.eql({'content-type': 'application/json', password: '********'});
1720+
// Verify response headers capture and case-insensitive scrubbing
1721+
expect(body.data.body.telemetry[0].body.response.headers).to.eql({'content-type': 'application/json', password: '********'});
17161722

1717-
// Assert that the original stream reader hasn't been read.
1718-
expect(response.bodyUsed).to.eql(false);
1723+
// Assert that the original stream reader hasn't been read.
1724+
expect(response.bodyUsed).to.eql(false);
17191725

1720-
rollbar.configure({ autoInstrument: false });
1721-
window.fetch.restore();
1722-
window.Headers = originalHeaders;
1723-
done();
1726+
rollbar.configure({ autoInstrument: false });
1727+
window.fetch.restore();
1728+
window.Headers = originalHeaders;
1729+
done();
1730+
} catch (e) {
1731+
done(e);
1732+
}
1733+
});
17241734
} catch (e) {
17251735
done(e);
17261736
}

0 commit comments

Comments
 (0)