Skip to content

Commit a144d52

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 8f14d27 commit a144d52

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
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
});

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16445,6 +16445,11 @@ node-addon-api@^3.0.0:
1644516445
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161"
1644616446
integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==
1644716447

16448+
16449+
version "2.1.2"
16450+
resolved "https://registry.yarnpkg.com/node-cleanup/-/node-cleanup-2.1.2.tgz#7ac19abd297e09a7f72a71545d951b517e4dde2c"
16451+
integrity sha1-esGavSl+Caf3KnFUXZUbUX5N3iw=
16452+
1644816453
1644916454
version "1.0.6"
1645016455
resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088"

0 commit comments

Comments
 (0)