-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update prettier command in package.json and pr-check yml
- Loading branch information
1 parent
fb276ab
commit dbeced5
Showing
15 changed files
with
110 additions
and
57 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,18 +93,18 @@ describe("getOnlyEmail", () => { | |
expect(result).toBe("[email protected]"); | ||
}); | ||
|
||
it('should clean the domain from the email when cleanDomain is true', () => { | ||
it("should clean the domain from the email when cleanDomain is true", () => { | ||
const result = getOnlyEmail( | ||
"Entre em contato com a equipe: [email protected]", | ||
{ cleanDomain: true } | ||
{ cleanDomain: true }, | ||
); | ||
expect(result).toBe("[email protected]"); | ||
}); | ||
|
||
it('should clean the domain from the email using a custom domain list', () => { | ||
it("should clean the domain from the email using a custom domain list", () => { | ||
const result = getOnlyEmail( | ||
"Entre em contato com a equipe: [email protected]", | ||
{ cleanDomain: [".custom"] } | ||
{ cleanDomain: [".custom"] }, | ||
); | ||
expect(result).toBe("[email protected]"); | ||
}); | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,15 +88,21 @@ describe("validateEmail", () => { | |
|
||
it("should throw an error when errorMsg is not an array or null", () => { | ||
// @ts-ignore | ||
expect(() => validateEmail("[email protected]", { errorMsg: 123 })).toThrow("errorMsg must be an Array or null"); | ||
expect(() => validateEmail("[email protected]", { errorMsg: 123 })).toThrow( | ||
"errorMsg must be an Array or null", | ||
); | ||
}); | ||
|
||
it("should throw an error if any element of the errorMsg array is different from string or null", () => { | ||
expect(() => validateEmail("[email protected]", { errorMsg: [123 as any] })).toThrow("All values within the array must be strings or null/undefined."); | ||
}) | ||
expect(() => | ||
validateEmail("[email protected]", { errorMsg: [123 as any] }), | ||
).toThrow("All values within the array must be strings or null/undefined."); | ||
}); | ||
|
||
it("should throw an error when maxLength must be a number and cannot be less than 1", () => { | ||
expect(() => validateEmail("[email protected]", { maxLength: 0 })).toThrow("maxLength must be a number and cannot be less than 1"); | ||
expect(() => validateEmail("[email protected]", { maxLength: 0 })).toThrow( | ||
"maxLength must be a number and cannot be less than 1", | ||
); | ||
}); | ||
|
||
it("should invalidate an email that does not end with the country code", () => { | ||
|
@@ -110,4 +116,4 @@ describe("validateEmail", () => { | |
expect(result.isValid).toBe(true); | ||
expect(result.errorMsg).toBe(null); | ||
}); | ||
}); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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