fix(config): name malformed local identity errors
This commit is contained in:
@@ -141,6 +141,24 @@ test('context validator rejects forged config fields and malformed identity', ()
|
||||
);
|
||||
});
|
||||
|
||||
test('context validator names identity when a forged context omits the identity object', () => {
|
||||
const base = validContext();
|
||||
for (const identity of [null, undefined]) {
|
||||
assert.throws(
|
||||
() => assertLocalStartupContext({
|
||||
...base,
|
||||
config: { ...base.config, identity },
|
||||
} as unknown as LocalStartupContext),
|
||||
(error: unknown) => {
|
||||
assert.ok(error instanceof Error);
|
||||
assert.match(error.message, /identity/i);
|
||||
assert.ok((error as Error & { cause?: unknown }).cause instanceof Error);
|
||||
return true;
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('connection target must be a valid URL from the authoritative local profile', () => {
|
||||
const context = validContext();
|
||||
assert.doesNotThrow(() => assertLocalConnectionTarget(context, 'ws://127.0.0.1:3088'));
|
||||
|
||||
Reference in New Issue
Block a user