Skip to content

Commit 069cab2

Browse files
committed
fix(tests): update tests to match validator and config changes
1 parent 87318c0 commit 069cab2

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,10 +1466,10 @@ describe('CliRepl', function () {
14661466
cliRepl.config.logRetentionGB = testLogRetentionGB;
14671467
await cliRepl.start(await testServer.connectionString(), {});
14681468

1469-
expect(cliRepl.getConfig('logRetentionGB')).equals(
1469+
expect(await cliRepl.getConfig('logRetentionGB')).equals(
14701470
testLogRetentionGB
14711471
);
1472-
expect(cliRepl.logManager?._options.logRetentionGB).equals(
1472+
expect(cliRepl.logManager?._options.retentionGB).equals(
14731473
testLogRetentionGB
14741474
);
14751475
});

packages/e2e-tests/test/e2e.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,15 +1581,15 @@ describe('e2e', function () {
15811581
await shell.waitForPrompt();
15821582
shell.assertContainsOutput('Ignoring config option "logLocation"');
15831583
shell.assertContainsOutput(
1584-
'must be a valid absolute path or empty'
1584+
'must be a valid absolute path or undefined'
15851585
);
15861586

15871587
expect(
15881588
await shell.executeLine(
15891589
'config.set("logLocation", "[123123123123]")'
15901590
)
15911591
).contains(
1592-
'Cannot set option "logLocation": logLocation must be a valid absolute path or empty'
1592+
'Cannot set option "logLocation": logLocation must be a valid absolute path or undefined'
15931593
);
15941594
});
15951595

packages/types/src/index.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ describe('config validation', function () {
3232
'logRetentionDays must be a positive integer'
3333
);
3434
expect(await validate('logRetentionGB', 'foo')).to.equal(
35-
'logRetentionGB must be a positive integer'
35+
'logRetentionGB must be a positive number or undefined'
36+
);
37+
expect(await validate('logRetentionGB', -1)).to.equal(
38+
'logRetentionGB must be a positive number or undefined'
3639
);
40+
expect(await validate('logRetentionGB', undefined)).to.equal(null);
41+
expect(await validate('logRetentionGB', 100)).to.equal(null);
3742
expect(await validate('logRetentionDays', -1)).to.equal(
3843
'logRetentionGB must be a positive integer'
3944
);

0 commit comments

Comments
 (0)