Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cspell.words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ cldr
cldrjs
htpasswd
basicauth
usersfile
usersfile
zibri
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monux-cli",
"version": "2.3.0",
"version": "2.4.0",
"license": "MIT",
"main": "index.js",
"engines": {
Expand Down
37 changes: 37 additions & 0 deletions src/commands/add/add-zibri/add-zibri-command.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { afterEach, beforeEach, describe, expect, jest, test } from '@jest/globals';

import { FileMockUtilities, getMockConstants, MAX_ADD_TIME, MockConstants, inquireMock } from '../../../__testing__';
import { DbType } from '../../../db';
import { InquirerUtilities } from '../../../encapsulation';
import { AddConfiguration, AddType } from '../models';
import { AddZibriCommand } from './add-zibri.command';

const mockConstants: MockConstants = getMockConstants('add-zibri-command');

describe('AddZibriCommand', () => {
beforeEach(async () => {
await FileMockUtilities.setup(mockConstants);
InquirerUtilities['inquire'] = jest.fn(inquireMock({
'sub domain': 'api',
port: 3000,
'Email of the default user': 'test@test.com',
'Password of the default user': 'stringstring',
'Name of the frontend where the reset password ui is implemented': 'admin',
'Database compose service': 'NEW',
'Compose service name': 'db',
'Database name': 'sandbox',
'database type': DbType.POSTGRES
}));
});

test('should run and add a new database', async () => {
const baseConfig: AddConfiguration = { name: 'api', type: AddType.ZIBRI };
const command: AddZibriCommand = new AddZibriCommand(baseConfig);
await command.run();
expect(true).toBe(true);
}, MAX_ADD_TIME);

afterEach(() => {
jest.restoreAllMocks();
});
});
Loading