Skip to content

Commit

Permalink
Refactor: Move 'delay' of integration tests to 'utils' folder
Browse files Browse the repository at this point in the history
  • Loading branch information
idillon-sfl committed Nov 29, 2023
1 parent 338ed23 commit 25b9d43
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
5 changes: 1 addition & 4 deletions integration-tests/src/tests/bitbake-commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import * as assert from 'assert'
import * as vscode from 'vscode'
import { afterEach } from 'mocha'

async function delay (ms: number): Promise<void> {
await new Promise(resolve => setTimeout(resolve, ms))
}
import { delay } from '../utils/async'

suite('Bitbake Commands Test Suite', () => {
let disposables: vscode.Disposable[] = []
Expand Down
5 changes: 1 addition & 4 deletions integration-tests/src/tests/bitbake-parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import { afterEach } from 'mocha'

import path from 'path'
import { addLayer, resetLayer } from '../utils/bitbake'

async function delay (ms: number): Promise<void> {
await new Promise(resolve => setTimeout(resolve, ms))
}
import { delay } from '../utils/async'

suite('Bitbake Commands Test Suite', () => {
let disposables: vscode.Disposable[] = []
Expand Down
5 changes: 1 addition & 4 deletions integration-tests/src/tests/completion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import * as assert from 'assert'
import * as vscode from 'vscode'
import path from 'path'

async function delay (ms: number): Promise<void> {
await new Promise(resolve => setTimeout(resolve, ms))
}
import { delay } from '../utils/async'

suite('Bitbake Completion Test Suite', () => {
const filePath = path.resolve(__dirname, '../../project-folder/sources/meta-fixtures/completion.bb')
Expand Down
5 changes: 1 addition & 4 deletions integration-tests/src/tests/hover.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import * as assert from 'assert'
import * as vscode from 'vscode'
import path from 'path'

async function delay (ms: number): Promise<void> {
await new Promise(resolve => setTimeout(resolve, ms))
}
import { delay } from '../utils/async'

suite('Bitbake Hover Test Suite', () => {
const filePath = path.resolve(__dirname, '../../project-folder/sources/meta-fixtures/hover.bb')
Expand Down
5 changes: 1 addition & 4 deletions integration-tests/src/tests/vscode-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import * as assert from 'assert'
import { after } from 'mocha'
import * as vscode from 'vscode'

async function delay (ms: number): Promise<void> {
await new Promise(resolve => setTimeout(resolve, ms))
}
import { delay } from '../utils/async'

suite('VSCode integration Test Suite', () => {
suiteSetup(async function (this: Mocha.Context) {
Expand Down
8 changes: 8 additions & 0 deletions integration-tests/src/utils/async.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) 2023 Savoir-faire Linux. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */

export async function delay (ms: number): Promise<void> {
await new Promise(resolve => setTimeout(resolve, ms))
}

0 comments on commit 25b9d43

Please sign in to comment.