Commit bc73b79e authored by Robert Knight's avatar Robert Knight

Convert raven-test mocking to babel-plugin-mockable-imports

parent 9a80b6ac
'use strict';
const proxyquire = require('proxyquire');
const noCallThru = require('../../shared/test/util').noCallThru;
const raven = require('../raven');
function fakeExceptionData(scriptURL) {
return {
......@@ -28,7 +27,6 @@ describe('raven', function() {
let fakeAngularTransformer;
let fakeAngularPlugin;
let fakeRavenJS;
let raven;
beforeEach(function() {
fakeRavenJS = {
......@@ -52,13 +50,14 @@ describe('raven', function() {
Raven.setDataCallback(fakeAngularTransformer);
});
raven = proxyquire(
'../raven',
noCallThru({
'raven-js': fakeRavenJS,
'raven-js/plugins/angular': fakeAngularPlugin,
})
);
raven.$imports.$mock({
'raven-js': fakeRavenJS,
'raven-js/plugins/angular': fakeAngularPlugin,
});
});
afterEach(() => {
raven.$imports.$restore();
});
describe('.install()', function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment