microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
70f7cae4a697f9868d22dfdd08089a2cd2076772

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/test/debugger/setup.test.ts

18lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4/* This setup is just to install the source-map-support, so we'll get TypeScript stack traces
5 for the tests */
6import * as fs from "fs";
7
8// source-map-support has a bug that crashes some of our tests. We fix it: https://github.com/evanw/node-source-map-support/issues/131
9const moduleLocation = require.resolve("source-map-support/source-map-support.js");
10const originalCode = "column -= 62;";
11const replacementCode = "if (column > 63) { column -= 62; }";
12const contents = fs.readFileSync(moduleLocation, "utf8");
13const fixedContents = contents.replace(originalCode, replacementCode);
14fs.writeFileSync(moduleLocation, fixedContents);
15
16// Then we load the module
17import * as sourceMapSupport from "source-map-support";
18sourceMapSupport.install(); // Enable stack traces translation to typescript
19