Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test coverage for moduleFilenameHelpers #16851

Closed
TheLarkInn opened this issue Mar 21, 2023 · 6 comments
Closed

Add test coverage for moduleFilenameHelpers #16851

TheLarkInn opened this issue Mar 21, 2023 · 6 comments

Comments

@TheLarkInn
Copy link
Member

After approving #16756, I realized we do not have coverage (that I could find) for this or other moduleFilenameHelper scenarios.

Documentation usages:
https://webpack.js.org/configuration/output/#outputdevtoolmodulefilenametemplate

Let's add a set of cases to cover this in tests.

@dhananjay0610
Copy link

Hi, @TheLarkInn can I start working on this, can you please assign this to me..

@alexander-akait
Copy link
Member

You can send a PR

@webpack-bot
Copy link
Contributor

This issue had no activity for at least three months.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@webpack-bot
Copy link
Contributor

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

@ArchitGajjar
Copy link

Hi @TheLarkInn - is this issue still open ? can i work on this ?

@mayankkamboj47
Copy link

mayankkamboj47 commented Nov 6, 2023

@TheLarkInn I've opened a PR. But I couldn't test some parts of the file, because the examples/test cases you guys left out in the comments actually don't match the output the functions give.

For replaceDuplicates, the comment says :

 const array = ["a", "b", "c", "a", "b", "a"];
 const result = ModuleFilenameHelpers.replaceDuplicates(array, (item, index, count) => `${item}-${count}`);
 // result: ["a-1", "b-1", "c", "a-2", "b-2", "a-3"]

But the actual output starts counting from 0, ["a-0", "b-0", "c-0", "a-1", "b-1", "a-2"]

For matchPart, the comment says

 ModuleFilenameHelpers.matchPart("foo.js", "foo."); // false

but the actual output is true.

Once you reply, I will first update the functions and then add tests for them. Let me know whether I should add the updates in a separate PR or the same one. Thanks ! I'm excited to make my first ever contribution that isn't just stylistic or a one-liner :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Priority - Low
Development

No branches or pull requests

6 participants