microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/test/debugger/sourceMap.test.ts
21lines · modeblame
3c2eeb5cJimmy Thomson10 years ago | 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 | import {SourceMapUtil} from "../../debugger/sourceMap"; | |
| 5 | | |
| 6 | import * as assert from "assert"; | |
81226dceJimmy Thomson10 years ago | 7 | import * as path from "path"; |
3c2eeb5cJimmy Thomson10 years ago | 8 | |
| 9 | suite("sourceMap", function() { | |
| 10 | suite("debuggerContext", function() { | |
81226dceJimmy Thomson10 years ago | 11 | test("should convert host filesystem paths to URL-style-paths", function() { |
3c2eeb5cJimmy Thomson10 years ago | 12 | const sourceMap = new SourceMapUtil(); |
81226dceJimmy Thomson10 years ago | 13 | const filePath = path.join("foo", "bar", "baz"); |
| 14 | const urlPath = "foo/bar/baz"; | |
| 15 | const result = (<any>sourceMap).makeUnixStylePath(filePath); | |
| 16 | assert(result === urlPath, `Expected "${urlPath}", found "${result}`); | |
3c2eeb5cJimmy Thomson10 years ago | 17 | }); |
81226dceJimmy Thomson10 years ago | 18 | |
| 19 | // TODO: This class definitely needs more tests | |
3c2eeb5cJimmy Thomson10 years ago | 20 | }); |
| 21 | }); |