Skip to content

Commit f23531e

Browse files
adding test coverage to 80%+
1 parent 7aa5ea8 commit f23531e

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎src/tests/LoggerConfigTest.test.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { getLoggerWithFilePath, logger } from '../main/wrapper/loggerConfig';
2+
import * as fs from 'fs';
3+
import * as path from 'path';
4+
5+
describe('Logger Configuration', () => {
6+
it('should initialize logger with file path', () => {
7+
const tempDir = path.join(__dirname, '../../tmp');
8+
if (!fs.existsSync(tempDir)) {
9+
fs.mkdirSync(tempDir, { recursive: true });
10+
}
11+
12+
const logFilePath = path.join(tempDir, 'test.log');
13+
14+
// This should call configurationWithFile and cover line 4
15+
getLoggerWithFilePath(logFilePath);
16+
17+
expect(logger).toBeDefined();
18+
});
19+
20+
it('should initialize logger without file path', () => {
21+
// This should call configurationWithoutFile
22+
getLoggerWithFilePath();
23+
24+
expect(logger).toBeDefined();
25+
});
26+
});

0 commit comments

Comments
 (0)