-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: merging data-source options (#829)
* chore(release): 3.2.0 [skip ci] # [3.2.0](v3.1.1...v3.2.0) (2023-11-25) ### Bug Fixes * **deps:** bump @faker-js/faker from 8.2.0 to 8.3.1 ([#782](#782)) ([fa7a114](fa7a114)) * **deps:** bump locter from 1.2.2 to 1.2.3 ([#779](#779)) ([e89daea](e89daea)) ### Features * seeder with non default export ([#776](#776)) ([e1fe651](e1fe651)) * fix: merging env and file data-source options * test: add test suite for merging data source options --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
- Loading branch information
1 parent
305d0c2
commit 1d0261a
Showing
5 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions'; | ||
import { mergeDataSourceOptions } from '../../../../src'; | ||
|
||
describe('src/data-source/options/merge', () => { | ||
it('should merge data source options', () => { | ||
const options = mergeDataSourceOptions({ | ||
type: 'postgres', | ||
password: undefined, | ||
}, { | ||
type: 'postgres', | ||
password: 'password', | ||
}); | ||
|
||
expect(options).toBeDefined(); | ||
expect(options.type).toEqual('postgres'); | ||
expect((options as PostgresConnectionOptions).password).toEqual('password'); | ||
}); | ||
|
||
it('should not merge data source options', () => { | ||
const options = mergeDataSourceOptions({ | ||
type: 'postgres', | ||
password: undefined, | ||
}, { | ||
type: 'mysql', | ||
password: 'password', | ||
}); | ||
|
||
expect(options).toBeDefined(); | ||
expect(options.type).toEqual('postgres'); | ||
expect((options as PostgresConnectionOptions).password).toBeUndefined(); | ||
}); | ||
}); |