Skip to content

Commit 62a7c63

Browse files
committed
test: add node cleanup in comments and resetModule
1 parent e7b6e8f commit 62a7c63

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

packages/cactus-test-cmd-api-server/src/test/typescript/integration/runtime-plugin-imports.test.ts

+19-19
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ import {
1212
PluginImportType,
1313
} from "@hyperledger/cactus-core-api";
1414

15-
const nodeCleanup = require("node-cleanup");
15+
//const nodeCleanup = require("node-cleanup");
1616
const logLevel: LogLevelDesc = "TRACE";
1717
const testCase = "can import plugins at runtime (CLI)";
1818
describe(testCase, () => {
1919
let apiServer: ApiServer;
2020

21+
beforeAll(() => {
22+
jest.resetModules();
23+
});
24+
2125
test(testCase, async () => {
2226
const pluginsPath = path.join(
2327
__dirname, // start at the current file's path
@@ -69,24 +73,20 @@ describe(testCase, () => {
6973
];
7074
await expect(apiServer.start()).not.toReject();
7175
});
72-
7376
afterAll(async () => {
74-
nodeCleanup(afterAll, (exitCode: unknown, signal: unknown) => {
75-
if (!signal) {
76-
apiServer.shutdown;
77-
} else {
78-
apiServer.shutdown;
79-
console.log("gets into the else statement");
80-
}
81-
});
82-
//await apiServer.shutdown();
77+
await apiServer.shutdown();
78+
// nodeCleanup(test, (exitCode: unknown) => {
79+
// if (exitCode == 0) {
80+
// console.log("gets into the first if statement");
81+
// afterAll(async () => {
82+
// await apiServer.shutdown();
83+
// });
84+
// } else {
85+
// console.log("gets into the second if statement");
86+
// afterAll(async () => {
87+
// await apiServer.shutdown();
88+
// });
89+
// }
90+
// });
8391
});
84-
// nodeCleanup(, (exitCode: unknown, signal: unknown) => {
85-
// if (!signal) {
86-
// apiServer.shutdown;
87-
// } else {
88-
// apiServer.shutdown;
89-
// console.log("gets into the else statement");
90-
// }
91-
// });
9292
});

0 commit comments

Comments
 (0)