Skip to content

Commit

Permalink
basic tests
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
  • Loading branch information
slimsag committed Mar 27, 2024
1 parent 80cc1c5 commit 3ab65e3
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions vscode/src/completions/providers/create-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,29 +87,28 @@ describe('createProviderConfig', () => {
expect(provider?.model).toBe('starcoder-hybrid')
})

// TODO: test 'openaicompatible'
// it('returns "fireworks" provider config and corresponding model if specified', async () => {
// const provider = await createProviderConfig(
// getVSCodeConfigurationWithAccessToken({
// autocompleteAdvancedProvider: 'fireworks',
// autocompleteAdvancedModel: 'starcoder-7b',
// }),
// dummyCodeCompletionsClient,
// dummyAuthStatus
// )
// expect(provider?.identifier).toBe('fireworks')
// expect(provider?.model).toBe('starcoder-7b')
// })
it('returns "experimental-openaicompatible" provider config and corresponding model if specified', async () => {
const provider = await createProviderConfig(
getVSCodeConfigurationWithAccessToken({
autocompleteAdvancedProvider: 'experimental-openaicompatible',
autocompleteAdvancedModel: 'starchat-16b-beta',
}),
dummyCodeCompletionsClient,
dummyAuthStatus
)
expect(provider?.identifier).toBe('openaicompatible')
expect(provider?.model).toBe('starchat-16b-beta')
})

// it('returns "fireworks" provider config if specified in settings and default model', async () => {
// const provider = await createProviderConfig(
// getVSCodeConfigurationWithAccessToken({ autocompleteAdvancedProvider: 'fireworks' }),
// dummyCodeCompletionsClient,
// dummyAuthStatus
// )
// expect(provider?.identifier).toBe('fireworks')
// expect(provider?.model).toBe('starcoder-hybrid')
// })
it('returns "experimental-openaicompatible" provider config if specified in settings and default model', async () => {
const provider = await createProviderConfig(
getVSCodeConfigurationWithAccessToken({ autocompleteAdvancedProvider: 'experimental-openaicompatible' }),
dummyCodeCompletionsClient,
dummyAuthStatus
)
expect(provider?.identifier).toBe('experimental-openaicompatible')

Check failure on line 109 in vscode/src/completions/providers/create-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 20)

src/completions/providers/create-provider.test.ts > createProviderConfig > if completions provider field is not defined in VSCode settings > returns "experimental-openaicompatible" provider config if specified in settings and default model

AssertionError: expected 'openaicompatible' to be 'experimental-openaicompatible' // Object.is equality - Expected + Received - experimental-openaicompatible + openaicompatible ❯ src/completions/providers/create-provider.test.ts:109:42

Check failure on line 109 in vscode/src/completions/providers/create-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (windows, 20)

src/completions/providers/create-provider.test.ts > createProviderConfig > if completions provider field is not defined in VSCode settings > returns "experimental-openaicompatible" provider config if specified in settings and default model

AssertionError: expected 'openaicompatible' to be 'experimental-openaicompatible' // Object.is equality - Expected + Received - experimental-openaicompatible + openaicompatible ❯ src/completions/providers/create-provider.test.ts:109:42

Check failure on line 109 in vscode/src/completions/providers/create-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (macos, 20)

src/completions/providers/create-provider.test.ts > createProviderConfig > if completions provider field is not defined in VSCode settings > returns "experimental-openaicompatible" provider config if specified in settings and default model

AssertionError: expected 'openaicompatible' to be 'experimental-openaicompatible' // Object.is equality - Expected + Received - experimental-openaicompatible + openaicompatible ❯ src/completions/providers/create-provider.test.ts:109:42

Check failure on line 109 in vscode/src/completions/providers/create-provider.test.ts

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 16)

src/completions/providers/create-provider.test.ts > createProviderConfig > if completions provider field is not defined in VSCode settings > returns "experimental-openaicompatible" provider config if specified in settings and default model

AssertionError: expected 'openaicompatible' to be 'experimental-openaicompatible' // Object.is equality - Expected + Received - experimental-openaicompatible + openaicompatible ❯ src/completions/providers/create-provider.test.ts:109:42
expect(provider?.model).toBe('starchat-16b-beta')
})

it('returns "openai" provider config if specified in VSCode settings; model is ignored', async () => {
const provider = await createProviderConfig(
Expand Down

0 comments on commit 3ab65e3

Please sign in to comment.