Disable error sourcemaps during session test (#19504)

* Disable error sourcemaps during session test

* Also disable during the exceptions-specific test
This commit is contained in:
Wesley Wigham 2017-10-26 13:48:59 -07:00 committed by GitHub
parent 940175e23f
commit 6671485596

View File

@ -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;