Skip to content

Commit

Permalink
Test: Add test for devtool debug build option
Browse files Browse the repository at this point in the history
  • Loading branch information
deribaucourt committed Jan 3, 2025
1 parent 30391a0 commit 3fdc528
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/src/__tests__/unit-tests/ui/bitbake-commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import type childProcess from 'child_process'
import { BitbakeWorkspace } from '../../../ui/BitbakeWorkspace'
import { BitBakeProjectScanner } from '../../../driver/BitBakeProjectScanner'
import { BitbakeDriver } from '../../../driver/BitbakeDriver'
import { registerDevtoolCommands } from '../../../ui/BitbakeCommands'
import { addDevtoolDebugBuild, registerDevtoolCommands } from '../../../ui/BitbakeCommands'
import { clientNotificationManager } from '../../../ui/ClientNotificationManager'
import * as BitbakeTerminal from '../../../ui/BitbakeTerminal'
import * as ProcessUtils from '../../../utils/ProcessUtils'
import { LanguageClient } from 'vscode-languageclient/node'
import { IPty } from 'node-pty'
import { BitbakeScanResult } from '../../../lib/src/types/BitbakeScanResult'
import { BitbakeSettings } from '../../../lib/src/BitbakeSettings'

jest.mock('vscode')

Expand Down Expand Up @@ -87,4 +88,11 @@ describe('Devtool ide-sdk command', () => {
await ideSDKCommand('busybox')
expect(commandSpy).toHaveBeenCalledWith(expect.anything(), 'devtool ide-sdk -i code busybox core-image-minimal -t [email protected]', expect.anything())
})

it('should properly detect devtool modify options', async () => {
// Test addDevtoolDebugBuild
expect(addDevtoolDebugBuild('', {_bitbakeVersion: '3.0.0'} as BitbakeScanResult, {disableDevtoolDebugBuild: false} as BitbakeSettings)).toBe(' --debug-build')
expect(addDevtoolDebugBuild('', {_bitbakeVersion: '3.0.0'} as BitbakeScanResult, {disableDevtoolDebugBuild: true} as BitbakeSettings)).toBe('')
expect(addDevtoolDebugBuild('', {_bitbakeVersion: '1.0.0'} as BitbakeScanResult, {disableDevtoolDebugBuild: false} as BitbakeSettings)).toBe('')
})
})

0 comments on commit 3fdc528

Please sign in to comment.