aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/utils/miscs/email.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/utils/miscs/email.ts')
-rw-r--r--shared/utils/miscs/email.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/shared/utils/miscs/email.ts b/shared/utils/miscs/email.ts
index 6fac7621f..f9f1bd95b 100644
--- a/shared/utils/miscs/email.ts
+++ b/shared/utils/miscs/email.ts
@@ -15,6 +15,8 @@ class MockSmtpServer {
15 return this.emails.push(msg.email) 15 return this.emails.push(msg.email)
16 } 16 }
17 }) 17 })
18
19 process.on('exit', () => this.kill())
18 } 20 }
19 21
20 collectEmails (emailsCollection: object[]) { 22 collectEmails (emailsCollection: object[]) {
@@ -42,6 +44,8 @@ class MockSmtpServer {
42 } 44 }
43 45
44 kill () { 46 kill () {
47 if (!this.emailChildProcess) return
48
45 process.kill(this.emailChildProcess.pid) 49 process.kill(this.emailChildProcess.pid)
46 50
47 this.emailChildProcess = null 51 this.emailChildProcess = null