Skip to content

Commit 3d8765c

Browse files
committed
fix(tests): use temporary directory for custom log location
1 parent d138951 commit 3d8765c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

packages/cli-repl/src/cli-repl.spec.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,13 +1428,20 @@ describe('CliRepl', function () {
14281428
).to.have.lengthOf(1);
14291429
});
14301430

1431+
const customLogLocation = useTmpdir();
14311432
it('can set the log location', async function () {
1432-
const testPath = path.join('./test', 'path');
1433-
cliRepl.config.logLocation = testPath;
1433+
cliRepl.config.logLocation = customLogLocation.path;
14341434
await cliRepl.start(await testServer.connectionString(), {});
14351435

1436-
expect(await cliRepl.getConfig('logLocation')).equals(testPath);
1437-
expect(cliRepl.logWriter?.logFilePath).equals(testPath);
1436+
expect(await cliRepl.getConfig('logLocation')).equals(
1437+
customLogLocation.path
1438+
);
1439+
expect(cliRepl.logWriter?.logFilePath).equals(
1440+
path.join(
1441+
customLogLocation.path,
1442+
(cliRepl.logWriter?.logId as string) + '_log'
1443+
)
1444+
);
14381445
});
14391446
});
14401447

0 commit comments

Comments
 (0)