Skip to content

Commit

Permalink
fix(): fix concatenate operation when more than 2 dots in app name
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Nov 16, 2020
1 parent 096d7c1 commit f06b0fb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/compiler/helpers/get-value-or-default.ts
Expand Up @@ -60,7 +60,7 @@ export function getValueOfPath<T = any>(
isConcatInProgress = true;
continue;
} else if (isConcatInProgress && !fragment.endsWith('"')) {
path += '.';
path += fragment + '.';
continue;
} else if (fragment.endsWith('"')) {
path += stripDoubleQuotes(fragment);
Expand Down
22 changes: 18 additions & 4 deletions test/lib/compiler/helpers/get-value-or-default.spec.ts
Expand Up @@ -178,7 +178,10 @@ describe('Get Value or Default', () => {
entryFile: '',
projects: {
'test.project.v1.api': {
compilerOptions: {},
sourceRoot: 'apps/test.project.v1.api/src',
compilerOptions: {
tsConfigPath: 'apps/test.project.v1.api/tsconfig.app.json',
},
},
},
language: '',
Expand All @@ -188,11 +191,22 @@ describe('Get Value or Default', () => {
},
generateOptions: {},
};
let value = getValueOrDefault(
const sourceRoot = getValueOrDefault(
configuration,
'compilerOptions.webpack',
'sourceRoot',
'test.project.v1.api',
);
expect(value).toEqual(true);
const tsConfigPath = getValueOrDefault(
configuration,
'compilerOptions.tsConfigPath',
'test.project.v1.api',
);
expect(sourceRoot).toEqual(
configuration.projects['test.project.v1.api'].sourceRoot,
);
expect(tsConfigPath).toEqual(
configuration.projects['test.project.v1.api'].compilerOptions!
.tsConfigPath,
);
});
});

0 comments on commit f06b0fb

Please sign in to comment.