diff options
author | Hailey <me@haileyok.com> | 2024-09-30 13:56:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-30 13:56:49 -0700 |
commit | 669cdf222cf13ad07f3ec48fd4f32b64fa52ab88 (patch) | |
tree | cc53e66f419b7d5380f298f10a46d8f5a2b830bf /src/lib/strings/__tests__/email.test.ts | |
parent | 66f3068c583b2e9d0388c10804ecaa7086cd549a (diff) | |
download | voidsky-669cdf222cf13ad07f3ec48fd4f32b64fa52ab88.tar.zst |
Move email test to root tests dir (#5527)
Diffstat (limited to 'src/lib/strings/__tests__/email.test.ts')
-rw-r--r-- | src/lib/strings/__tests__/email.test.ts | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/lib/strings/__tests__/email.test.ts b/src/lib/strings/__tests__/email.test.ts deleted file mode 100644 index 4dfda658f..000000000 --- a/src/lib/strings/__tests__/email.test.ts +++ /dev/null @@ -1,82 +0,0 @@ -import {describe, expect, it} from '@jest/globals' -import tldts from 'tldts' - -import {isEmailMaybeInvalid} from '#/lib/strings/email' - -describe('emailTypoChecker', () => { - const invalidCases = [ - 'gnail.com', - 'gnail.co', - 'gmaill.com', - 'gmaill.co', - 'gmai.com', - 'gmai.co', - 'gmal.com', - 'gmal.co', - 'gmail.co', - 'iclod.com', - 'iclod.co', - 'outllok.com', - 'outllok.co', - 'outlook.co', - 'yaoo.com', - 'yaoo.co', - 'yaho.com', - 'yaho.co', - 'yahooo.com', - 'yahooo.co', - 'yahoo.co', - 'hithere.jul', - 'agpowj.notshop', - 'thisisnot.avalid.tld.nope', - // old tld for czechoslovakia - 'czechoslovakia.cs', - // tlds that cbs was registering in 2024 but cancelled - 'liveon.cbs', - 'its.showtime', - ] - const validCases = [ - 'gmail.com', - // subdomains (tests end of string) - 'gnail.com.test.com', - 'outlook.com', - 'yahoo.com', - 'icloud.com', - 'firefox.com', - 'firefox.co', - 'hello.world.com', - 'buy.me.a.coffee.shop', - 'mayotte.yt', - 'aland.ax', - 'bouvet.bv', - 'uk.gb', - 'chad.td', - 'somalia.so', - 'plane.aero', - 'cute.cat', - 'together.coop', - 'findme.jobs', - 'nightatthe.museum', - 'industrial.mil', - 'czechrepublic.cz', - 'lovakia.sk', - // new gtlds in 2024 - 'whatsinyour.locker', - 'letsmakea.deal', - 'skeet.now', - 'everyone.みんな', - 'bourgeois.lifestyle', - 'california.living', - 'skeet.ing', - 'listeningto.music', - 'createa.meme', - ] - - it.each(invalidCases)(`should be invalid: abcde@%s`, domain => { - expect(isEmailMaybeInvalid(`abcde@${domain}`, tldts)).toEqual(true) - }) - - it.each(validCases)(`should be valid: abcde@%s`, domain => { - expect(isEmailMaybeInvalid(`abcde@${domain}`, tldts)).toEqual(false) - }) -}) |