Skip to content

Commit d646849

Browse files
committed
fix(tests): update tests to match validator and config changes
1 parent 82bdc5d commit d646849

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
@@ -1589,15 +1589,15 @@ describe('e2e', function () {
15891589
await shell.waitForPrompt();
15901590
shell.assertContainsOutput('Ignoring config option "logLocation"');
15911591
shell.assertContainsOutput(
1592-
'must be a valid absolute path or empty'
1592+
'must be a valid absolute path or undefined'
15931593
);
15941594

15951595
expect(
15961596
await shell.executeLine(
15971597
'config.set("logLocation", "[123123123123]")'
15981598
)
15991599
).contains(
1600-
'Cannot set option "logLocation": logLocation must be a valid absolute path or empty'
1600+
'Cannot set option "logLocation": logLocation must be a valid absolute path or undefined'
16011601
);
16021602
});
16031603

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)