Merged
Conversation
thesocialdev
requested changes
Jan 26, 2025
ba6389e to
5a06010
Compare
5a06010 to
f85f330
Compare
Collaborator
|
The issue on test-lint occurs because of the way Jest resolves modules when rootDir is changed in the Jest config. When using:
Jest treats mongoose as an ES module, which can cause mongoose.Types to become undefined in certain configurations. The correct approach is to use:
This ensures that the CommonJS default export is correctly resolved, avoiding issues when Jest's rootDir is modified. Fix: Replace all instances of import * as mongoose from "mongoose"; with import mongoose from "mongoose"; throughout the project to ensure proper module resolution |
59c52fe to
cbf7f6a
Compare
d80fa3d to
89875ea
Compare
89875ea to
6e781c8
Compare
|
thesocialdev
approved these changes
Feb 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
I limited the TLD to two characters from 'a' to 'z', so it accepts more options without restricting it to a set of TLDs. Additionally, I created a unit test to test some various URLs. The test uses a forEach on an array of predefined links, applying the URL pattern.
In conversation with @caneppelevitor, he conducted an in-depth investigation, and it was agreed that a change is needed in how we run Jest tests on the platform, as well as the possibility of separating the tests. Since this change may require a greater effort, it might make more sense to implement it in another PR.
In this PR, I kept the improvement of the pattern and encapsulated it in another component so that we can test only the URL validation functionality. I placed the test file in the appropriate location, alongside the component that contains this functionality, as it is independent and should not undergo changes after we fix and separate the unit tests on the platform.
Fixes #1791
Type of change
Testing
Create a font in the report and test with various types of TLDs.
Developer Checklist
General
console.logor related logging is added.Tests
Merge Request Review Checklist