Skip to content

Commit

Permalink
fix tests & format
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Jan 8, 2024
1 parent e71d6fd commit 71dfc4b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
8 changes: 4 additions & 4 deletions extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ export class Extension {
const storageProvider = new StorageProvider(ctx?.globalState)

// Display any notifications from remote server
flowVersion.getValue().then(flowVersion => {
void flowVersion.getValue().then(flowVersion => {
if (flowVersion == null) return
const notificationFilter = (notifications: Notification[]) => filterNotifications(notifications, storageProvider, {
'vscode-cadence': this.ctx.extension.packageJSON.version ?? '0.0.0',
const notificationFilter = (notifications: Notification[]): Notification[] => filterNotifications(notifications, storageProvider, {
'vscode-cadence': this.ctx.extension.packageJSON.version,
'flow-cli': flowVersion.version
})
fetchNotifications(notificationFilter).then(notifications => {
void fetchNotifications(notificationFilter).then(notifications => {
displayNotifications(notifications, storageProvider)
})
})
Expand Down
4 changes: 2 additions & 2 deletions extension/src/ui/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function displayNotifications (notifications: Notification[], storageProv
}

export function displayNotification (notification: Notification, storageProvider: StorageProvider): void {
const transformButton = (button: { label: string, link: string }) => {
const transformButton = (button: { label: string, link: string }): { label: string, callback: () => void } => {
return {
label: button.label,
callback: () => {
Expand Down Expand Up @@ -56,7 +56,7 @@ export function displayNotification (notification: Notification, storageProvider

export function filterNotifications (notifications: Notification[], storageProvider: StorageProvider, currentVersions: { 'vscode-cadence': string, 'flow-cli': string }): Notification[] {
return notifications.filter(notification => {
if (notification.suppressable && isNotificationDismissed(notification, storageProvider)) {
if (notification.suppressable === true && isNotificationDismissed(notification, storageProvider)) {
return false
}

Expand Down
4 changes: 0 additions & 4 deletions extension/test/integration/2 - commands.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { getMockSettings } from '../mock/mockSettings'
import { Settings } from '../../src/settings/settings'
import { MaxTimeout } from '../globals'
import { before, after } from 'mocha'
import * as assert from 'assert'
Expand All @@ -9,14 +7,12 @@ import { DependencyInstaller } from '../../src/dependency-installer/dependency-i
import * as sinon from 'sinon'

suite('Extension Commands', () => {
let settings: Settings
let checkDependenciesStub: sinon.SinonStub
let mockDependencyInstaller: DependencyInstaller
let commandController: CommandController

before(async function () {
this.timeout(MaxTimeout)
settings = getMockSettings()

// Initialize the command controller & mock dependencies
checkDependenciesStub = sinon.stub()
Expand Down

0 comments on commit 71dfc4b

Please sign in to comment.