mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-31 15:18:38 -04:00
test: add and use a mocked DatabaseConfig
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
89297e748f
commit
513d64493e
2 changed files with 24 additions and 0 deletions
22
src/config/mock/database.config.mock.ts
Normal file
22
src/config/mock/database.config.mock.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { registerAs } from '@nestjs/config';
|
||||
|
||||
import { DatabaseDialect } from '../database-dialect.enum';
|
||||
import { DatabaseConfig } from '../database.config';
|
||||
|
||||
export default registerAs(
|
||||
'databaseConfig',
|
||||
(): DatabaseConfig => ({
|
||||
dialect: (process.env.HEDGEDOC_TEST_DB_TYPE || 'sqlite') as DatabaseDialect,
|
||||
database: 'hedgedoc',
|
||||
password: 'hedgedoc',
|
||||
host: 'localhost',
|
||||
port: 0,
|
||||
storage: '',
|
||||
username: 'hedgedoc',
|
||||
}),
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue