-
-
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: clean up test files and update package dependencies
- Loading branch information
1 parent
f341123
commit 12d3650
Showing
11 changed files
with
355 additions
and
344 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
|
@@ -66,21 +66,21 @@ | |
"Breno A" | ||
], | ||
"devDependencies": { | ||
"@types/jest": "^29.5.13", | ||
"@types/node": "^22.7.7", | ||
"@typescript-eslint/eslint-plugin": "^7.2.0", | ||
"@typescript-eslint/parser": "^7.2.0", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^22.10.5", | ||
"@typescript-eslint/eslint-plugin": "^8.19.1", | ||
"@typescript-eslint/parser": "^8.19.1", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"jest": "^29.7.0", | ||
"prettier": "^3.3.3", | ||
"prettier": "^3.4.2", | ||
"ts-jest": "^29.2.5", | ||
"ts-loader": "^9.5.1", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.6.3", | ||
"webpack": "^5.95.0", | ||
"webpack-cli": "^5.1.4" | ||
"typescript": "^5.7.2", | ||
"webpack": "^5.97.1", | ||
"webpack-cli": "^6.0.1" | ||
}, | ||
"packageManager": "[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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
const fs = require('fs'); | ||
const fs = require("fs"); | ||
|
||
// Assinatura PNG: [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A] | ||
const pngSignature = [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]; | ||
const pngSignature = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]; | ||
const fakePNG = new Uint8Array([...pngSignature, ...new Array(100).fill(0)]); // 100 bytes extras vazios | ||
fs.writeFileSync('fake.png', fakePNG); | ||
fs.writeFileSync("fake.png", fakePNG); | ||
|
||
// Assinatura GIF: [0x47, 0x49, 0x46, 0x38, 0x37, 0x61] (GIF89a) ou [0x47, 0x49, 0x46, 0x38, 0x37, 0x61] (GIF87a) | ||
const gifSignature = [0x47, 0x49, 0x46, 0x38, 0x37, 0x61]; | ||
const fakeGIF = new Uint8Array([...gifSignature, ...new Array(100).fill(0)]); // 100 bytes extras vazios | ||
fs.writeFileSync('fake87a.gif', fakeGIF); | ||
fs.writeFileSync("fake87a.gif", fakeGIF); | ||
|
||
// Assinatura GIF89a: [0x47, 0x49, 0x46, 0x38, 0x39, 0x61] | ||
const gif89aSignature = [0x47, 0x49, 0x46, 0x38, 0x39, 0x61]; | ||
const fakeGIF89a = new Uint8Array([...gif89aSignature, ...new Array(100).fill(0)]); // 100 bytes extras vazios | ||
fs.writeFileSync('fake89a.gif', fakeGIF89a); | ||
const fakeGIF89a = new Uint8Array([ | ||
...gif89aSignature, | ||
...new Array(100).fill(0), | ||
]); // 100 bytes extras vazios | ||
fs.writeFileSync("fake89a.gif", fakeGIF89a); | ||
|
||
// Assinatura JPEG: [0xFF, 0xD8, 0xFF] | ||
const jpegSignature = [0xFF, 0xD8, 0xFF]; | ||
const jpegSignature = [0xff, 0xd8, 0xff]; | ||
const fakeJPEG = new Uint8Array([...jpegSignature, ...new Array(100).fill(0)]); // 100 bytes extras vazios | ||
fs.writeFileSync('fake.jpeg', fakeJPEG); | ||
fs.writeFileSync("fake.jpeg", fakeJPEG); |
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 |
---|---|---|
|
@@ -112,23 +112,23 @@ describe("getOnlyEmail", () => { | |
it("should return the first email when repeatEmail is true and multiple is false", () => { | ||
const result = getOnlyEmail( | ||
"Entre em contato com a equipe: [email protected], [email protected]", | ||
{ multiple: false, cleanDomain: false, repeatEmail: true } | ||
{ multiple: false, cleanDomain: false, repeatEmail: true }, | ||
); | ||
expect(result).toBe("[email protected]"); | ||
}); | ||
|
||
it("should return the first cleaned email when repeatEmail is true and multiple is false", () => { | ||
const result = getOnlyEmail( | ||
"Entre em contato com a equipe: [email protected], [email protected]", | ||
{ multiple: false, cleanDomain: true, repeatEmail: true } | ||
{ multiple: false, cleanDomain: true, repeatEmail: true }, | ||
); | ||
expect(result).toBe("[email protected]"); | ||
}); | ||
}); | ||
|
||
it("should return all cleaned emails when repeatEmail is true and multiple is true", () => { | ||
const result = getOnlyEmail( | ||
"Entre em contato com a equipe: [email protected], [email protected]", | ||
{ multiple: true, cleanDomain: true, repeatEmail: true } | ||
{ multiple: true, cleanDomain: true, repeatEmail: true }, | ||
); | ||
expect(result).toEqual(["[email protected]", "[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
Oops, something went wrong.