diff --git a/src/test/suite/extension.test.ts b/src/test/suite/extension.test.ts index 80cb566..7e1588e 100644 --- a/src/test/suite/extension.test.ts +++ b/src/test/suite/extension.test.ts @@ -1,24 +1,28 @@ -import * as assert from 'assert'; -import * as vscode from 'vscode'; +import * as assert from "assert"; +import * as vscode from "vscode"; -import { createFile, clearDirectory, getLastMessage } from './common'; +import { createFile, clearDirectory, getLastMessage } from "./common"; -suite('Extension Test Suite', () => { +suite("Extension Test Suite", () => { const { workspaceFolders } = vscode.workspace; - const directoryPath = workspaceFolders ? workspaceFolders[0].uri.fsPath : ''; + const directoryPath = workspaceFolders ? workspaceFolders[0].uri.fsPath : ""; suiteTeardown(() => clearDirectory(directoryPath)); test('should commit with "chore" type', async () => { - const sampleSubject = 'add new file'; - const expectedMessage = `chore: ${sampleSubject}`; + const sampleSubject = "add new file"; + const expectedMessage = `build: ${sampleSubject}`; - await createFile(directoryPath, 'Hello World'); + await createFile(directoryPath, "Hello World"); await vscode.env.clipboard.writeText(sampleSubject); - await vscode.commands.executeCommand('gitSemanticCommit.semanticCommit'); - await vscode.commands.executeCommand('editor.action.clipboardPasteAction'); - await vscode.commands.executeCommand('workbench.action.quickOpenSelectNext'); - await vscode.commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); + await vscode.commands.executeCommand("gitSemanticCommit.semanticCommit"); + await vscode.commands.executeCommand("editor.action.clipboardPasteAction"); + await vscode.commands.executeCommand( + "workbench.action.quickOpenSelectNext" + ); + await vscode.commands.executeCommand( + "workbench.action.acceptSelectedQuickOpenItem" + ); await new Promise(resolve => setTimeout(resolve, 3000)); const { stdout: message } = await getLastMessage(directoryPath); @@ -26,19 +30,25 @@ suite('Extension Test Suite', () => { }); test('should commit with a scope and "chore" type', async () => { - const sampleScope = 'scope'; - const sampleSubject = 'add new file'; - const expectedMessage = `chore(${sampleScope}): ${sampleSubject}`; + const sampleScope = "scope"; + const sampleSubject = "add new file"; + const expectedMessage = `build(${sampleScope}): ${sampleSubject}`; - await createFile(directoryPath, 'Hello World'); + await createFile(directoryPath, "Hello World"); await vscode.env.clipboard.writeText(sampleScope); - await vscode.commands.executeCommand('gitSemanticCommit.semanticCommit'); - await vscode.commands.executeCommand('editor.action.clipboardPasteAction'); - await vscode.commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); + await vscode.commands.executeCommand("gitSemanticCommit.semanticCommit"); + await vscode.commands.executeCommand("editor.action.clipboardPasteAction"); + await vscode.commands.executeCommand( + "workbench.action.acceptSelectedQuickOpenItem" + ); await vscode.env.clipboard.writeText(sampleSubject); - await vscode.commands.executeCommand('editor.action.clipboardPasteAction'); - await vscode.commands.executeCommand('workbench.action.quickOpenSelectNext'); - await vscode.commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); + await vscode.commands.executeCommand("editor.action.clipboardPasteAction"); + await vscode.commands.executeCommand( + "workbench.action.quickOpenSelectNext" + ); + await vscode.commands.executeCommand( + "workbench.action.acceptSelectedQuickOpenItem" + ); await new Promise(resolve => setTimeout(resolve, 3000)); const { stdout: message } = await getLastMessage(directoryPath);