Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit b97e925

Browse files
committed
test: add await to dispatch
1 parent 7de77e7 commit b97e925

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/linter-eslint-spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async function makeFixes(textEditor) {
9595

9696
// Subscriptions now active for Editor Reload and Message Notification
9797
// Send off a fix request.
98-
atom.commands.dispatch(atom.views.getView(textEditor), 'linter-eslint:fix-file')
98+
await atom.commands.dispatch(atom.views.getView(textEditor), 'linter-eslint:fix-file')
9999

100100
const notification = await notificationPromise
101101
expect(notification.getMessage()).toBe(expectedMessage)
@@ -221,7 +221,7 @@ describe('The eslint provider for Linter', () => {
221221
const editor = await atom.workspace.open(paths.ignored)
222222
const expectedMessage = 'Linter-ESLint: Fix complete.'
223223
const notificationPromise = getNotification(expectedMessage)
224-
atom.commands.dispatch(atom.views.getView(editor), 'linter-eslint:fix-file')
224+
await atom.commands.dispatch(atom.views.getView(editor), 'linter-eslint:fix-file')
225225
const notification = await notificationPromise
226226

227227
expect(notification.getMessage()).toBe(expectedMessage)
@@ -481,7 +481,7 @@ describe('The eslint provider for Linter', () => {
481481

482482
it('shows an info notification', async () => {
483483
const notificationPromise = getNotification(expectedMessage)
484-
atom.commands.dispatch(atom.views.getView(editor), 'linter-eslint:debug')
484+
await atom.commands.dispatch(atom.views.getView(editor), 'linter-eslint:debug')
485485
const notification = await notificationPromise
486486

487487
expect(notification.getMessage()).toBe(expectedMessage)
@@ -490,7 +490,7 @@ describe('The eslint provider for Linter', () => {
490490

491491
it('includes debugging information in the details', async () => {
492492
const notificationPromise = getNotification(expectedMessage)
493-
atom.commands.dispatch(atom.views.getView(editor), 'linter-eslint:debug')
493+
await atom.commands.dispatch(atom.views.getView(editor), 'linter-eslint:debug')
494494
const notification = await notificationPromise
495495
const detail = notification.getDetail()
496496

0 commit comments

Comments
 (0)