mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
Fix notebook file URI test by adding a required forward slash to Windows file paths. (#15550)
This commit is contained in:
@@ -19,6 +19,7 @@ import * as constants from '../../common/constants';
|
||||
|
||||
import { NotebookUriHandler } from '../../protocol/notebookUriHandler';
|
||||
import { CellTypes } from '../../contracts/content';
|
||||
import { winPlatform } from '../../common/constants';
|
||||
|
||||
describe('Notebook URI Handler', function (): void {
|
||||
let notebookUriHandler: NotebookUriHandler;
|
||||
@@ -127,7 +128,14 @@ describe('Notebook URI Handler', function (): void {
|
||||
let notebookPath: string = path.join(notebookDir, 'hello.ipynb');
|
||||
|
||||
await fs.mkdir(notebookDir);
|
||||
let fileURI = 'azuredatastudio://microsoft.notebook/open?url=file://' + notebookPath;
|
||||
let baseUrl = 'azuredatastudio://microsoft.notebook/open?url=file://';
|
||||
if (process.platform === winPlatform) {
|
||||
// URI paths are formatted as "hostname/path", but since we're using a local path
|
||||
// we omit the host part and just add the slash. Unix paths already start with a
|
||||
// forward slash, but we have to prepend it manually when using Windows paths.
|
||||
baseUrl = baseUrl + '/';
|
||||
}
|
||||
let fileURI = baseUrl + notebookPath;
|
||||
let fileNotebookUri = vscode.Uri.parse(fileURI);
|
||||
let notebookContent: azdata.nb.INotebookContents = {
|
||||
cells: [{
|
||||
|
||||
Reference in New Issue
Block a user