Skip to content

Commit fe4ce3c

Browse files
committed
Cleanup
1 parent 8a0f64b commit fe4ce3c

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

packages/cli/src/benchmark/lib/global-hooks.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ function n8nDir() {
2020

2121
writeFileSync(
2222
path.join(_n8nDir, 'config'),
23-
JSON.stringify({ encryptionKey: 'temp_encryption_key', instanceId: '123' }),
23+
JSON.stringify({ encryptionKey: 'temp_encryption_key', instanceId: 'temp-123' }),
2424
'utf-8',
2525
);
2626

2727
/**
28-
* @TODO Better approach? Setting N8N_USER_FOLDER has no effect
28+
* @TODO Better approach than overriding? Setting N8N_USER_FOLDER has no effect
2929
*/
3030
const instanceSettings = Container.get(InstanceSettings);
3131
instanceSettings.n8nFolder = _n8nDir;
@@ -46,7 +46,7 @@ async function mainProcess() {
4646
await main.run();
4747
}
4848

49-
async function setup() {
49+
export async function setup() {
5050
n8nDir();
5151

5252
await mainProcess();
@@ -56,9 +56,6 @@ async function setup() {
5656
await createOwner();
5757
}
5858

59-
async function teardown() {
59+
export async function teardown() {
6060
await main.stopProcess();
6161
}
62-
63-
/** Lifecycle hooks to run once before and after all benchmarking tasks. */
64-
export const globalHooks = { setup, teardown };

packages/cli/src/benchmark/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'reflect-metadata';
2-
import { globalHooks } from './lib/global-hooks';
2+
import * as globalHooks from './lib/global-hooks';
33
import { collectSuites, registerSuites, suiteCount } from './lib/suites';
44

55
/* eslint-disable import/no-extraneous-dependencies */

0 commit comments

Comments
 (0)