Skip to content

Commit

Permalink
Extra regression test added
Browse files Browse the repository at this point in the history
  • Loading branch information
gpawlik committed Dec 9, 2017
1 parent 59dbd49 commit 64e3ab4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,43 @@ describe('module-resolver', () => {
);
});
});

describe('correct alias order application', () => {
const arrayAliasTransformerOpts = {
babelrc: false,
plugins: [
[plugin, {
alias: [{
'~/foo': './src/lib/foo',
}, {
'~/bar': './src/lib/bar',
}, {
'~': './src',
}],
}],
],
};

it('should resolve aliases following the insertion order', () => {
testWithImport(
'~/foo',
'./src/lib/foo',
arrayAliasTransformerOpts,
);

testWithImport(
'~/bar',
'./src/lib/bar',
arrayAliasTransformerOpts,
);

testWithImport(
'~',
'./src',
arrayAliasTransformerOpts,
);
});
});
});

describe('with custom cwd', () => {
Expand Down

0 comments on commit 64e3ab4

Please sign in to comment.