Skip to content

Commit 7ef29cf

Browse files
committed
test(cmd-api-server): fix flaky runtime-plugin-imports test
Fixes hyperledger-cacti#1667 Signed-off-by: Youngone Lee <[email protected]>
1 parent b917435 commit 7ef29cf

File tree

3 files changed

+638
-610
lines changed

3 files changed

+638
-610
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
"lerna": "4.0.0",
121121
"lint-staged": "11.1.2",
122122
"make-dir-cli": "3.0.0",
123+
"node-cleanup": "2.1.2",
123124
"node-polyfill-webpack-plugin": "1.1.4",
124125
"npm-run-all": "4.1.5",
125126
"npm-watch": "0.11.0",

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ import {
1212
PluginImportType,
1313
} from "@hyperledger/cactus-core-api";
1414

15+
const nodeCleanup = require("node-cleanup");
1516
const logLevel: LogLevelDesc = "TRACE";
1617
const testCase = "can import plugins at runtime (CLI)";
1718
describe(testCase, () => {
1819
let apiServer: ApiServer;
20+
1921
test(testCase, async () => {
2022
const pluginsPath = path.join(
2123
__dirname, // start at the current file's path
@@ -67,5 +69,8 @@ describe(testCase, () => {
6769
];
6870
await expect(apiServer.start()).not.toReject();
6971
});
70-
afterAll(async () => await apiServer.shutdown());
72+
afterAll(async () => {
73+
await apiServer.shutdown();
74+
nodeCleanup();
75+
});
7176
});

0 commit comments

Comments
 (0)