Fix tests and reformatting
* Fix command-linting tests. * Fix failing windows test and Use Uri.parse(_, true) * Use Uri.parse(_, true). That is the preferred API. * Reformat comments.
This commit is contained in:
@@ -44,7 +44,10 @@ export enum WebviewReveal {
|
||||
NotForced,
|
||||
}
|
||||
|
||||
/** Converts a filesystem URI into a webview URI string that the given panel can use to read the file. */
|
||||
/**
|
||||
* Converts a filesystem URI into a webview URI string that the given panel
|
||||
* can use to read the file.
|
||||
*/
|
||||
export function fileUriToWebviewUri(
|
||||
panel: WebviewPanel,
|
||||
fileUriOnDisk: Uri
|
||||
|
||||
@@ -36,7 +36,7 @@ describe('fileRangeFromURI', () => {
|
||||
|
||||
function createMockDatabaseItem(): DatabaseItem {
|
||||
return {
|
||||
resolveSourceFile: (uri: string) => Uri.parse('file://' + uri, true)
|
||||
resolveSourceFile: (file: string) => Uri.file(file)
|
||||
} as DatabaseItem;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -32,6 +32,7 @@ describe('interface-utils', () => {
|
||||
localResourceRoots: [fileUriOnDisk],
|
||||
}
|
||||
);
|
||||
|
||||
after(function() {
|
||||
panel.dispose();
|
||||
tmpFile.removeCallback();
|
||||
|
||||
@@ -29,15 +29,20 @@ describe('commands declared in package.json', function() {
|
||||
|
||||
commands.forEach((commandDecl: CmdDecl) => {
|
||||
const { command, title } = commandDecl;
|
||||
if (command.match(/^codeQL\./)
|
||||
if (
|
||||
command.match(/^codeQL\./)
|
||||
|| command.match(/^codeQLQueryResults\./)
|
||||
|| command.match(/^codeQLTests\./)) {
|
||||
|| command.match(/^codeQLTests\./)
|
||||
) {
|
||||
paletteCmds.add(command);
|
||||
expect(title).not.to.be.undefined;
|
||||
commandTitles[command] = title!;
|
||||
}
|
||||
else if (command.match(/^codeQLDatabases\./)
|
||||
|| command.match(/^codeQLQueryHistory\./)) {
|
||||
else if (
|
||||
command.match(/^codeQLDatabases\./)
|
||||
|| command.match(/^codeQLQueryHistory\./)
|
||||
|| command.match(/^codeQLAstViewer\./)
|
||||
) {
|
||||
scopedCmds.add(command);
|
||||
expect(title).not.to.be.undefined;
|
||||
commandTitles[command] = title!;
|
||||
@@ -97,5 +102,3 @@ describe('commands declared in package.json', function() {
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user