Skip to content

Commit

Permalink
fix postMessage result
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Jan 30, 2024
1 parent f858c19 commit 82b0ae7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/backend/src/managers/playground.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ beforeEach(() => {
});

test('startPlayground should fail if no provider', async () => {
mocks.postMessage.mockResolvedValue(undefined);
mocks.getContainerConnections.mockReturnValue([]);
await expect(manager.startPlayground('model1', '/path/to/model')).rejects.toThrowError(
'Unable to find an engine to start playground',
);
});

test('startPlayground should download image if not present then create container', async () => {
mocks.postMessage.mockResolvedValue(undefined);
mocks.getContainerConnections.mockReturnValue([
{
connection: {
Expand Down Expand Up @@ -122,6 +124,7 @@ test('stopPlayground should fail if no playground is running', async () => {
});

test('stopPlayground should stop a started playground', async () => {
mocks.postMessage.mockResolvedValue(undefined);
mocks.getContainerConnections.mockReturnValue([
{
connection: {
Expand Down

0 comments on commit 82b0ae7

Please sign in to comment.