Skip to content

Commit

Permalink
📦 Chore: add console for message
Browse files Browse the repository at this point in the history
  • Loading branch information
upupming committed Apr 26, 2021
1 parent e170f45 commit 43c41a8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
20 changes: 14 additions & 6 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,27 @@ function addPeriod(message: string) {
return message
}

export function showWarning(message: string) {
function decorateMessage(message: string): string {
message = addPeriod(message)
return window.showWarningMessage(`${nls['ext.displayName']}: ${message}`)
return `${nls['ext.displayName']}: ${message}`
}

export function showWarning(message: string) {
message = decorateMessage(message)
console.warn(message)
return window.showWarningMessage(message)
}

export function showError(message: string) {
message = addPeriod(message)
return window.showErrorMessage(`${nls['ext.displayName']}: ${message}`)
message = decorateMessage(message)
console.error(message)
return window.showErrorMessage(message)
}

export function showInfo(message: string) {
message = addPeriod(message)
return window.showInformationMessage(`${nls['ext.displayName']}: ${message}`)
message = decorateMessage(message)
console.info(message)
return window.showInformationMessage(message)
}

/**
Expand Down
6 changes: 5 additions & 1 deletion test/run-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ async function main() {
const extensionTestsPath = path.resolve(__dirname, './runner/index')

// Download VS code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath })
await runTests({
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: ['--disable-extensions']
})
} catch (err) {
console.log(err)
console.error('Failed to run tests')
Expand Down

0 comments on commit 43c41a8

Please sign in to comment.