Skip to content

Commit 0930747

Browse files
committed
Fix test
Current tests for paths are generated for windows paths.
1 parent d612d50 commit 0930747

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/tests/nativeScriptPathTransformer.tests.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as assert from 'assert';
22
import * as fs from 'fs';
3+
import * as path from 'path';
34
import * as sinon from 'sinon';
45
import { NativeScriptPathTransformer } from '../debug-adapter/nativeScriptPathTransformer';
56
import * as tests from './pathTransformData';
@@ -17,6 +18,8 @@ describe('NativeScriptPathTransformer', () => {
1718

1819
for (const test of tests as any) {
1920
it(`should transform [${test.platform}] device path ${test.scriptUrl} -> ${test.expectedResult}`, async () => {
21+
(path as any).join = path.win32.join;
22+
(path as any).resolve = path.win32.resolve;
2023
nativeScriptPathTransformer.setTargetPlatform(test.platform);
2124
existsSyncStub = sinon.stub(fs, 'existsSync').callsFake((arg: string) => arg === test.existingPath);
2225

src/tests/pathTransformData.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* tslint:disable:max-line-length */
12
const tests = [
23
{ platform: 'android', scriptUrl: 'file:///data/data/org.nativescript.TabNavigation/files/app/main.js', expectedResult: 'C:\\projectpath\\app\\main.js', existingPath: 'C:\\projectpath\\app\\main.js' },
34
{ platform: 'android', scriptUrl: 'VM1', expectedResult: 'VM1' },

0 commit comments

Comments
 (0)