Skip to content

Commit abca587

Browse files
committed
test(logger): update e2e persistentKey check
1 parent fec3943 commit abca587

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/logger/tests/e2e/childLogger.manual.test.FunctionCode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import type { LogLevel } from '../../src/types/index.js';
44
import type { TestEvent, TestOutput } from '../helpers/types.js';
55

66
const PERSISTENT_KEY = process.env.PERSISTENT_KEY || 'persistentKey';
7-
const PERSISTENT_VALUE = process.env.ERSISTENT_VALUE || 'persistentValue';
7+
const PERSISTENT_VALUE = process.env.PERSISTENT_VALUE || 'persistentValue';
88
const PARENT_LOG_MSG = process.env.PARENT_LOG_MSG || 'parent-only-log-msg';
99
const CHILD_LOG_MSG = process.env.CHILD_LOG_MSG || 'child-only-log-msg';
1010
const CHILD_LOG_LEVEL = (process.env.CHILD_LOG_LEVEL || 'warn') as LogLevel;
1111

1212
const parentLogger = new Logger({
13-
persistentLogAttributes: {
13+
persistentKeys: {
1414
[PERSISTENT_KEY]: PERSISTENT_VALUE,
1515
},
1616
});

packages/logger/tests/e2e/childLogger.manual.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ describe('Logger E2E tests, child logger', () => {
119119
});
120120

121121
it('both logger instances should have the same persistent key/value', () => {
122-
const { PERSISTENT_KEY: persistentKey } = commonEnvironmentVars;
122+
const {
123+
PERSISTENT_KEY: persistentKey,
124+
PERSISTENT_VALUE: persistentValue,
125+
} = commonEnvironmentVars;
123126

124127
for (let i = 0; i < invocationCount; i++) {
125128
// Get log messages of the invocation
@@ -128,7 +131,7 @@ describe('Logger E2E tests, child logger', () => {
128131
// Check that all logs have the persistent key/value
129132
for (const message of logMessages) {
130133
const log = TestInvocationLogs.parseFunctionLog(message);
131-
expect(log).toHaveProperty(persistentKey);
134+
expect(log).toHaveProperty(persistentKey, persistentValue);
132135
}
133136
}
134137
});

0 commit comments

Comments
 (0)