Skip to content

Commit

Permalink
feat(config): add deep_merge alias test
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Aug 31, 2021
1 parent 616cd07 commit 33bccef
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/kit/src/core/config/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,4 +501,30 @@ deepMergeSuite('merge including toString', () => {
assert.equal(Object.keys(merged), ['toString', 'constructor', 'y']);
});

deepMergeSuite('merge resolve.alias', () => {
const [merged, conflicts] = deep_merge(
{
resolve: {
alias: [{ find: /foo/, replacement: 'bar' }]
}
},
{
resolve: {
alias: {
alpha: 'beta'
}
}
}
);
assert.equal(conflicts.length, 0);
assert.equal(merged, {
resolve: {
alias: [
{ find: /foo/, replacement: 'bar' },
{ find: 'alpha', replacement: 'beta' }
]
}
});
});

deepMergeSuite.run();

0 comments on commit 33bccef

Please sign in to comment.