fix JavaScript master build

fixes: COREFE-229

2 things:
1. there was a problem with deprecated.test.js where node would
   run out of memory
2. When raven went to log stuff it would die because it would try
   to use window.fetch, but that is just a mocked function in jest

Change-Id: Ib8a4de3605606a9bf0496634f93bfed3731a5d1a
Reviewed-on: https://gerrit.instructure.com/206857
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
Ryan Shaw 2019-08-26 16:56:11 -06:00
parent ff2055d08e
commit 9284d36869
2 changed files with 5 additions and 4 deletions

View File

@ -27,10 +27,7 @@ describe('deprecated', () => {
let originalFn
beforeEach(() => {
originalFn = jest.fn()
jest.spyOn(global.console, 'warn').mockImplementation()
})
afterEach(() => {
global.console.warn.mockRestore()
jest.spyOn(console, 'warn').mockImplementation()
})
it('only logs deprecation message once', () => {

View File

@ -37,7 +37,11 @@ export default function setupRavenConsoleLoggingPlugin(client, options) {
}
};
// make raven think window.fetch is unavailable so it doesn't use the mocked one
const fetch = window.fetch
delete window.fetch
client.captureMessage(msg, data);
window.fetch = fetch
}
}
});