chore(vscode): update to 1.53.2
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
This commit is contained in:
@ -20,6 +20,11 @@ async function getLinksForFile(file: vscode.Uri): Promise<vscode.DocumentLink[]>
|
||||
|
||||
suite('Markdown Document links', () => {
|
||||
|
||||
setup(async () => {
|
||||
// the tests make the assumption that link providers are already registered
|
||||
await vscode.extensions.getExtension('vscode.markdown-language-features')!.activate();
|
||||
});
|
||||
|
||||
teardown(async () => {
|
||||
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
|
||||
});
|
||||
|
@ -21,12 +21,31 @@ suite('markdown.engine', () => {
|
||||
test('Renders a document', async () => {
|
||||
const doc = new InMemoryDocument(testFileName, input);
|
||||
const engine = createNewMarkdownEngine();
|
||||
assert.strictEqual(await engine.render(doc), output);
|
||||
assert.strictEqual((await engine.render(doc)).html, output);
|
||||
});
|
||||
|
||||
test('Renders a string', async () => {
|
||||
const engine = createNewMarkdownEngine();
|
||||
assert.strictEqual(await engine.render(input), output);
|
||||
assert.strictEqual((await engine.render(input)).html, output);
|
||||
});
|
||||
});
|
||||
|
||||
suite('image-caching', () => {
|
||||
const input = ' [](no-img.png)   ';
|
||||
|
||||
test('Extracts all images', async () => {
|
||||
const engine = createNewMarkdownEngine();
|
||||
assert.deepStrictEqual((await engine.render(input)), {
|
||||
html: '<p data-line="0" class="code-line">'
|
||||
+ '<img src="img.png" alt="" class="loading" id="image-hash--754511435"> '
|
||||
+ '<a href="no-img.png" data-href="no-img.png"></a> '
|
||||
+ '<img src="http://example.org/img.png" alt="" class="loading" id="image-hash--1903814170"> '
|
||||
+ '<img src="img.png" alt="" class="loading" id="image-hash--754511435"> '
|
||||
+ '<img src="./img2.png" alt="" class="loading" id="image-hash-265238964">'
|
||||
+ '</p>\n'
|
||||
,
|
||||
containingImages: [{ src: 'img.png' }, { src: 'http://example.org/img.png' }, { src: 'img.png' }, { src: './img2.png' }],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const path = require('path');
|
||||
const testRunner = require('vscode/lib/testrunner');
|
||||
const testRunner = require('../../../../test/integration/electron/testrunner');
|
||||
|
||||
const options: any = {
|
||||
ui: 'tdd',
|
||||
|
@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { deepStrictEqual } from 'assert';
|
||||
import 'mocha';
|
||||
import { Uri } from 'vscode';
|
||||
import { urlToUri } from '../util/url';
|
||||
|
||||
suite('urlToUri', () => {
|
||||
test('Absolute File', () => {
|
||||
deepStrictEqual(
|
||||
urlToUri('file:///root/test.txt', Uri.parse('file:///usr/home/')),
|
||||
Uri.parse('file:///root/test.txt')
|
||||
);
|
||||
});
|
||||
|
||||
test('Relative File', () => {
|
||||
deepStrictEqual(
|
||||
urlToUri('./file.ext', Uri.parse('file:///usr/home/')),
|
||||
Uri.parse('file:///usr/home/file.ext')
|
||||
);
|
||||
});
|
||||
|
||||
test('Http Basic', () => {
|
||||
deepStrictEqual(
|
||||
urlToUri('http://example.org?q=10&f', Uri.parse('file:///usr/home/')),
|
||||
Uri.parse('http://example.org?q=10&f')
|
||||
);
|
||||
});
|
||||
|
||||
test('Http Encoded Chars', () => {
|
||||
deepStrictEqual(
|
||||
urlToUri('http://example.org/%C3%A4', Uri.parse('file:///usr/home/')),
|
||||
Uri.parse('http://example.org/%C3%A4')
|
||||
);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user