e0a5f57793
Vendor the rebranded BoosAPI Desktop client (Tauri + Vue) into metapi as a monorepo subdirectory under desktop/. Source only — node_modules, dist, Cargo target and the upstream .git history are excluded. desktop/ keeps its own independent Cargo workspace (desktop/src-tauri with crates/*); it is not part of the backend boosapi crate, so a `cargo check` at the metapi root still compiles only the backend. Build the desktop app from desktop/src-tauri per desktop/README.md. Note: app icons are still placeholder assets pending the final BoosAPI logo. The updater signing keys live outside the repo and are not included.
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
describe('optional monaco dependency', () => {
|
|
it('should handle missing stream-monaco gracefully', async () => {
|
|
// Dynamically import the monaco module
|
|
const { getUseMonaco } = await import('../src/components/CodeBlockNode/monaco')
|
|
|
|
// Mock the import to simulate missing package
|
|
// In a real scenario where stream-monaco is not installed,
|
|
// the import will fail and getUseMonaco should return null
|
|
// This test verifies the function exists and can be called
|
|
const result = await getUseMonaco()
|
|
|
|
// If stream-monaco is installed (as it is in the dev environment),
|
|
// result will be the module. If not installed, result will be null.
|
|
// The important thing is that no error is thrown.
|
|
expect(typeof result === 'object' || result === null).toBe(true)
|
|
})
|
|
|
|
it('should cache the import result', async () => {
|
|
const { getUseMonaco } = await import('../src/components/CodeBlockNode/monaco')
|
|
|
|
// Call twice to test caching
|
|
const result1 = await getUseMonaco()
|
|
const result2 = await getUseMonaco()
|
|
|
|
// Both calls should return the same result (either the module or null)
|
|
expect(result1).toBe(result2)
|
|
})
|
|
})
|