Skip to content

Commit

Permalink
Merge pull request #2042 from micalevisk/patch-1
Browse files Browse the repository at this point in the history
perf(lib)!: prioritize 'nest-cli.json' file over all the others name patterns
  • Loading branch information
kamilmysliwiec committed Apr 24, 2023
2 parents 8d27341 + ac68fa8 commit 360c3ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/configuration/nest-configuration.loader.ts
Expand Up @@ -10,9 +10,9 @@ export class NestConfigurationLoader implements ConfigurationLoader {
const content: string | undefined = name
? await this.reader.read(name)
: await this.reader.readAnyOf([
'nest-cli.json',
'.nestcli.json',
'.nest-cli.json',
'nest-cli.json',
'nest.json',
]);

Expand Down
4 changes: 2 additions & 2 deletions test/lib/configuration/nest-configuration.loader.spec.ts
Expand Up @@ -29,13 +29,13 @@ describe('Nest Configuration Loader', () => {
});
reader = mock();
});
it('should call reader.readAnyOf when load', async () => {
it('should call reader.readAnyOf when load taking "nest-cli.json" as preferable', async () => {
const loader: ConfigurationLoader = new NestConfigurationLoader(reader);
const configuration: Configuration = await loader.load();
expect(reader.readAnyOf).toHaveBeenCalledWith([
'nest-cli.json',
'.nestcli.json',
'.nest-cli.json',
'nest-cli.json',
'nest.json',
]);
expect(configuration).toEqual({
Expand Down

0 comments on commit 360c3ae

Please sign in to comment.