diff --git a/index.js b/index.js index 18fc3bc..ef07555 100644 --- a/index.js +++ b/index.js @@ -24,6 +24,10 @@ var callbacks = []; */ function mock(superagent) { + // don't patch if superagent was patched already + if (superagent._patchedBySuperagentMocker) return mock; + superagent._patchedBySuperagentMocker = true; + // The room for matched route var state = { current: null };