@@ -2,28 +2,28 @@ import { quickValidateEmail, validateEmail } from './validation'
22
33describe ( 'Email Validation' , ( ) => {
44 describe ( 'validateEmail' , ( ) => {
5- it ( 'should validate a correct email' , async ( ) => {
5+ it . concurrent ( 'should validate a correct email' , async ( ) => {
66 const result = await validateEmail ( 'user@example.com' )
77 expect ( result . isValid ) . toBe ( true )
88 expect ( result . checks . syntax ) . toBe ( true )
99 expect ( result . checks . disposable ) . toBe ( true )
1010 } )
1111
12- it ( 'should reject invalid syntax' , async ( ) => {
12+ it . concurrent ( 'should reject invalid syntax' , async ( ) => {
1313 const result = await validateEmail ( 'invalid-email' )
1414 expect ( result . isValid ) . toBe ( false )
1515 expect ( result . reason ) . toBe ( 'Invalid email format' )
1616 expect ( result . checks . syntax ) . toBe ( false )
1717 } )
1818
19- it ( 'should reject disposable email addresses' , async ( ) => {
19+ it . concurrent ( 'should reject disposable email addresses' , async ( ) => {
2020 const result = await validateEmail ( 'test@10minutemail.com' )
2121 expect ( result . isValid ) . toBe ( false )
2222 expect ( result . reason ) . toBe ( 'Disposable email addresses are not allowed' )
2323 expect ( result . checks . disposable ) . toBe ( false )
2424 } )
2525
26- it ( 'should accept legitimate business emails' , async ( ) => {
26+ it . concurrent ( 'should accept legitimate business emails' , async ( ) => {
2727 const legitimateEmails = [
2828 'test@gmail.com' ,
2929 'noreply@gmail.com' ,
@@ -38,13 +38,13 @@ describe('Email Validation', () => {
3838 }
3939 } )
4040
41- it ( 'should reject consecutive dots (RFC violation)' , async ( ) => {
41+ it . concurrent ( 'should reject consecutive dots (RFC violation)' , async ( ) => {
4242 const result = await validateEmail ( 'user..name@example.com' )
4343 expect ( result . isValid ) . toBe ( false )
4444 expect ( result . reason ) . toBe ( 'Email contains suspicious patterns' )
4545 } )
4646
47- it ( 'should reject very long local parts (RFC violation)' , async ( ) => {
47+ it . concurrent ( 'should reject very long local parts (RFC violation)' , async ( ) => {
4848 const longLocalPart = 'a' . repeat ( 65 )
4949 const result = await validateEmail ( `${ longLocalPart } @example.com` )
5050 expect ( result . isValid ) . toBe ( false )
@@ -53,20 +53,20 @@ describe('Email Validation', () => {
5353 } )
5454
5555 describe ( 'quickValidateEmail' , ( ) => {
56- it ( 'should validate quickly without MX check' , ( ) => {
56+ it . concurrent ( 'should validate quickly without MX check' , ( ) => {
5757 const result = quickValidateEmail ( 'user@example.com' )
5858 expect ( result . isValid ) . toBe ( true )
5959 expect ( result . checks . mxRecord ) . toBe ( true ) // Skipped, so assumed true
6060 expect ( result . confidence ) . toBe ( 'medium' )
6161 } )
6262
63- it ( 'should reject invalid emails quickly' , ( ) => {
63+ it . concurrent ( 'should reject invalid emails quickly' , ( ) => {
6464 const result = quickValidateEmail ( 'invalid-email' )
6565 expect ( result . isValid ) . toBe ( false )
6666 expect ( result . reason ) . toBe ( 'Invalid email format' )
6767 } )
6868
69- it ( 'should reject disposable emails quickly' , ( ) => {
69+ it . concurrent ( 'should reject disposable emails quickly' , ( ) => {
7070 const result = quickValidateEmail ( 'test@tempmail.org' )
7171 expect ( result . isValid ) . toBe ( false )
7272 expect ( result . reason ) . toBe ( 'Disposable email addresses are not allowed' )
0 commit comments