mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
test: Fix randomly failing UM tests (#3061)
* ⚡ Declutter test logs * 🐛 Fix random passwords length * 🐛 Fix password hashing in test user creation * 🐛 Hash leftover password * ⚡ Improve error message for `compare` * ⚡ Restore `randomInvalidPassword` contant * ⚡ Mock Telemetry module to prevent `--forceExit` * ⚡ Silence logger * ⚡ Simplify condition * ⚡ Unhash password in payload
This commit is contained in:
@@ -89,12 +89,13 @@ export function initTestServer({
|
||||
return testServer.app;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-requisite: Mock the telemetry module before calling.
|
||||
*/
|
||||
export function initTestTelemetry() {
|
||||
const mockNodeTypes = { nodeTypes: {} } as INodeTypes;
|
||||
|
||||
void InternalHooksManager.init('test-instance-id', 'test-version', mockNodeTypes);
|
||||
|
||||
jest.spyOn(Telemetry.prototype, 'track').mockResolvedValue();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,10 +118,9 @@ const classifyEndpointGroups = (endpointGroups: string[]) => {
|
||||
// ----------------------------------
|
||||
|
||||
/**
|
||||
* Initialize a silent logger for test runs.
|
||||
* Initialize a logger for test runs.
|
||||
*/
|
||||
export function initTestLogger() {
|
||||
config.set('logs.output', 'file'); // declutter console output
|
||||
LoggerProxy.init(getLogger());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user