microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0766856f41443745c16987486e91d4444e290f07

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/test/debugger/setup.test.ts

20lines · 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";
7import * as path from "path";
8
9// source-map-support has a bug that crashes some of our tests. We fix it
10const moduleRelativeLocation = "../../../node_modules/source-map-support/source-map-support.js";
11const moduleLocation = path.join(__dirname, moduleRelativeLocation);
12const originalCode = "column -= 62;";
13const replacementCode = "if (column > 63) { column -= 62; }";
14const contents = fs.readFileSync(moduleLocation, "utf8");
15const fixedContents = contents.replace(originalCode, replacementCode);
16fs.writeFileSync(moduleLocation, fixedContents);
17
18// Then we load the module
19import * as sourceMapSupport from "source-map-support";
20sourceMapSupport.install(); // Enable stack traces translation to typescript