We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 69ad463 + aba6c20 commit 3324144Copy full SHA for 3324144
src/index.js
@@ -28,6 +28,11 @@ const checkMxRecords = async (email) => {
28
const domain = email.split('@')[1];
29
30
try {
31
+ // Introduce a delay for testing purposes
32
+ if (process.env.NODE_ENV === 'test') {
33
+ await setTimeout(10); // Simulate a delay in DNS lookup
34
+ }
35
+
36
const records = await resolveMx(domain);
37
return records && records.length > 0;
38
} catch (error) {
0 commit comments