diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index 74c5de2bbaf..3d9f782b2e0 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -53,6 +53,17 @@ namespace ts.server { return new TestSession(opts); } + // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test + let oldPrepare: Function; + before(() => { + oldPrepare = (Error as any).prepareStackTrace; + delete (Error as any).prepareStackTrace; + }); + + after(() => { + (Error as any).prepareStackTrace = oldPrepare; + }); + beforeEach(() => { session = createSession(); session.send = (msg: protocol.Message) => { @@ -387,6 +398,18 @@ namespace ts.server { }); describe("exceptions", () => { + + // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test + let oldPrepare: Function; + before(() => { + oldPrepare = (Error as any).prepareStackTrace; + delete (Error as any).prepareStackTrace; + }); + + after(() => { + (Error as any).prepareStackTrace = oldPrepare; + }); + const command = "testhandler"; class TestSession extends Session { lastSent: protocol.Message;