Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit bbac74c

Browse files
author
Van-QA
committed
feat: add validation for stdout with localAPIserver
1 parent 2a06f17 commit bbac74c

File tree

3 files changed

+6
-70
lines changed

3 files changed

+6
-70
lines changed

cortex-js/src/infrastructure/commanders/test/helpers.command.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ describe('Helper commands', () => {
9191
expect(exitSpy.firstCall?.args[0]).toBe(1);
9292
});
9393

94-
test('Local API server via localhost:1337/api', async () => {
94+
test('Local API server via default host/port localhost:1337/api', async () => {
9595
await CommandTestFactory.run(commandInstance, ['serve']);
96+
expect(stdoutSpy.firstCall?.args[0]).toContain(
97+
'Started server at http://localhost:1337',
98+
);
9699

97100
// Add a delay of 1000 milliseconds (1 second)
98101
return new Promise<void>(async (resolve) => {

cortex-js/src/infrastructure/commanders/test/model-list.command.spec.ts

Lines changed: 0 additions & 67 deletions
This file was deleted.

cortex-js/src/infrastructure/commanders/test/models.command.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ afterEach(
3434
);
3535

3636
export const modelName = 'tinyllama';
37-
describe('Models list returns array of models', () => {
37+
describe('Action with models', () => {
3838
test('Init with CPU', async () => {
3939
const logMock = stubMethod(console, 'log');
4040

4141
logMock.passThrough();
4242
CommandTestFactory.setAnswers(['CPU', '', 'AVX2']);
4343

44-
await CommandTestFactory.run(commandInstance, ['init']);
44+
await CommandTestFactory.run(commandInstance, ['setup']);
4545
expect(logMock.firstCall?.args[0]).toBe(
4646
'Downloading engine file windows-amd64-avx2.tar.gz',
4747
);

0 commit comments

Comments
 (0)