Skip to content

Commit

Permalink
test(configurer): add envs in test
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Dec 31, 2023
1 parent 0740ed9 commit 5cceeb4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/unit/configurer/DatabaseConfigurerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default class DatabaseConfigurerTest {
`\nDB_CONNECTION=mysql\n` +
'DB_HOST=localhost\n' +
`DB_PORT=3306\n` +
'DB_DEBUG=false\n' +
'DB_USERNAME=root\n' +
'DB_PASSWORD=root\n' +
'DB_DATABASE=athenna\n'
Expand Down Expand Up @@ -93,6 +94,7 @@ export default class DatabaseConfigurerTest {
`\nDB_CONNECTION=mysql\n` +
'DB_HOST=localhost\n' +
`DB_PORT=3306\n` +
'DB_DEBUG=false\n' +
'DB_USERNAME=root\n' +
'DB_PASSWORD=root\n' +
'DB_DATABASE=athenna\n'
Expand Down Expand Up @@ -123,6 +125,7 @@ export default class DatabaseConfigurerTest {
`\nDB_CONNECTION=postgres\n` +
'DB_HOST=localhost\n' +
`DB_PORT=5432\n` +
'DB_DEBUG=false\n' +
'DB_USERNAME=root\n' +
'DB_PASSWORD=root\n' +
'DB_DATABASE=athenna\n'
Expand Down Expand Up @@ -159,6 +162,7 @@ export default class DatabaseConfigurerTest {
`\nDB_CONNECTION=postgres\n` +
'DB_HOST=localhost\n' +
`DB_PORT=5432\n` +
'DB_DEBUG=false\n' +
'DB_USERNAME=root\n' +
'DB_PASSWORD=root\n' +
'DB_DATABASE=athenna\n'
Expand All @@ -184,7 +188,10 @@ export default class DatabaseConfigurerTest {
dockerComposeFile,
"version: '3'\n\nservices:\n mongo:\n container_name: athenna_mongo\n image: mongo\n ports:\n - '27017:27017'\n environment:\n MONGO_INITDB_ROOT_USERNAME: root\n MONGO_INITDB_ROOT_PASSWORD: root\n"
)
assert.deepEqual(envFile, `\nDB_CONNECTION=mongo\n` + 'DB_URL=mongodb://root:root@localhost:27017/admin\n')
assert.deepEqual(
envFile,
`\nDB_CONNECTION=mongo\n` + 'DB_DEBUG=false\n' + 'DB_URL=mongodb://root:root@localhost:27017/admin\n'
)
}

@Test()
Expand All @@ -210,6 +217,9 @@ export default class DatabaseConfigurerTest {
dockerComposeFile,
"version: '3'\nservices:\n app:\n container_name: athenna_app\n mongo:\n container_name: athenna_mongo\n image: mongo\n ports:\n - '27017:27017'\n environment:\n MONGO_INITDB_ROOT_USERNAME: root\n MONGO_INITDB_ROOT_PASSWORD: root\n"
)
assert.deepEqual(envFile, `\nDB_CONNECTION=mongo\n` + 'DB_URL=mongodb://root:root@localhost:27017/admin\n')
assert.deepEqual(
envFile,
`\nDB_CONNECTION=mongo\n` + 'DB_DEBUG=false\n' + 'DB_URL=mongodb://root:root@localhost:27017/admin\n'
)
}
}

0 comments on commit 5cceeb4

Please sign in to comment.