From 844b47fb497d90f8755d3c9bbd5610e99df6c086 Mon Sep 17 00:00:00 2001 From: Marie Flores Date: Mon, 10 Oct 2022 09:29:59 +0200 Subject: [PATCH] Modify asciidoctorconfig.test.ts --- src/test/asciidoctorconfig.test.ts | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/test/asciidoctorconfig.test.ts b/src/test/asciidoctorconfig.test.ts index 0e559715..6a2dc20b 100644 --- a/src/test/asciidoctorconfig.test.ts +++ b/src/test/asciidoctorconfig.test.ts @@ -8,7 +8,6 @@ import * as assert from 'assert' import * as vscode from 'vscode' import { AsciidocParser } from '../asciidocParser' import { AsciidocContributionProvider, AsciidocContributions } from '../asciidocExtensions' -import { AsciidocPreview } from '../features/preview' import { AsciidoctorExtensionsSecurityPolicyArbiter } from '../security' import { WebviewResourceProvider } from '../util/resources' @@ -55,20 +54,11 @@ suite('asciidoc.Asciidoctorconfig', () => { }) test('Pick up config from root workspace folder', async () => { - const webview = vscode.window.createWebviewPanel( - AsciidocPreview.viewType, - 'Test', - vscode.ViewColumn.One - ) - try { - const root = vscode.workspace.workspaceFolders[0].uri.fsPath - const file = await vscode.workspace.openTextDocument(vscode.Uri.file(`${root}/attributes.adoc`)) - // eslint-disable-next-line max-len - const asciidocParser = new AsciidocParser(new AsciidocContributionProviderTest(extensionContext.extensionUri), new AsciidoctorExtensionsSecurityPolicyArbiter(extensionContext)) - const { html } = await asciidocParser.convertUsingJavascript(file.getText(), file, extensionContext, new TestWebviewResourceProvider()) - assert.strictEqual(html.includes('

Asciidoctor VS Code Extension

'), true, '{application-name} should be substituted by the value defined in .asciidoctorconfig') - } finally { - webview.dispose() - } + const root = vscode.workspace.workspaceFolders[0].uri.fsPath + const file = await vscode.workspace.openTextDocument(vscode.Uri.file(`${root}/attributes.adoc`)) + // eslint-disable-next-line max-len + const asciidocParser = new AsciidocParser(new AsciidocContributionProviderTest(extensionContext.extensionUri), new AsciidoctorExtensionsSecurityPolicyArbiter(extensionContext)) + const { html } = await asciidocParser.convertUsingJavascript(file.getText(), file, extensionContext, new TestWebviewResourceProvider()) + assert.strictEqual(html.includes('

Asciidoctor VS Code Extension

'), true, '{application-name} should be substituted by the value defined in .asciidoctorconfig') }) })