From e09e8f716095cf775e89486c97acb870327281fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Sadzi=C5=84ski?= Date: Thu, 22 Jun 2023 21:39:13 +0200 Subject: [PATCH] (core) Cleaning after app sumo and billing discount tests Summary: - Cleaning stripe data after billing tests - Better stripe webhook test integration, that should fix test interference - Not importing why-is-node-running when its not needed, which improves dev experience. Test Plan: Modified Reviewers: dsagal Reviewed By: dsagal Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3932 --- test/report-why-tests-hang.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/report-why-tests-hang.js b/test/report-why-tests-hang.js index 716fca23..03688a1c 100644 --- a/test/report-why-tests-hang.js +++ b/test/report-why-tests-hang.js @@ -6,12 +6,15 @@ * We use why-is-node-running module to print something informative. */ -/* global after */ - -const whyIsNodeRunning = require('why-is-node-running'); +// --no-exit|-E flag is interpreted by mocha-webdriver library to start REPL on failure, and we +// do NOT want to output a big dump about that. +const noexit = process.argv.includes("--no-exit") || process.argv.includes('-E'); +// Don't load why-is-node-running if we're not going to use it. It probably means that we're +// in a debugging session, and this module creates async hooks that interfere with debugging. +const whyIsNodeRunning = noexit ? null : require('why-is-node-running'); function report() { - whyIsNodeRunning(); + whyIsNodeRunning?.(); console.warn("*******************************************************"); console.warn("Something above prevented node from exiting on its own."); console.warn("*******************************************************"); @@ -21,9 +24,6 @@ function report() { } after(() => { - // --no-exit|-E flag is interpreted by mocha-webdriver library to start REPL on failure, and we - // do NOT want to output a big dump about that. - const noexit = process.argv.includes("--no-exit") || process.argv.includes('-E'); if (noexit) { console.log("report-why-tests-hang silenced with --no-exit flag"); } else {