Skip to content

Commit

Permalink
Merge pull request #2194 from posit-dev/bugfix/test-feature-windows-p…
Browse files Browse the repository at this point in the history
…aths

Use more portable paths in the test explorer
  • Loading branch information
jennybc authored Feb 2, 2024
2 parents 96b2978 + 0651020 commit 289f102
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extensions/positron-r/src/testing/runner-testthat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ export async function runThatTest(
}

const isSingleTest = testType === ItemType.TestThat;
const testPath = testType === ItemType.Directory ? testingTools.packageRoot.fsPath : test!.uri!.fsPath;

let testPath = testType === ItemType.Directory ? testingTools.packageRoot.fsPath : test!.uri!.fsPath;
Logger.info(
`Started running ${isSingleTest ? 'single test' : 'all tests'
} in ${testType === ItemType.Directory ? 'directory' : 'file'
} '${testPath}'`
);
// use POSIX path separators in the test-running R snippet for better portability
testPath = testPath.replace(/\\/g, '/');

const devtoolsMethod = testType === ItemType.Directory ? 'test' : 'test_active_file';
const descInsert = isSingleTest ? ` desc = '${test?.label || '<all tests>'}', ` : '';
Expand Down

0 comments on commit 289f102

Please sign in to comment.