You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
If you have two typed objects, actual and expect, of the same type, assertObjectMatch doesn't let you use the expect object:
import{assertObjectMatch}from'@std/assert';interfaceFirstLast{first: stringlast: string}Deno.test('assertObjectMatch',()=>{constexpected: FirstLast={first: 'John',last: 'Doe',};constactual=expected;// passesassertObjectMatch(actual,{first: 'John',last: 'Doe',});// fails because `expected` is too typed now?assertObjectMatch(actual,expected);// Argument of type 'FirstLast' is not assignable to parameter of type 'Record<PropertyKey, unknown>'.// Index signature for type 'string' is missing in type 'FirstLast'.// casting is ugly:assertObjectMatch(actual,expectedasunknownasRecord<PropertyKey,unknown>);});
Describe the solution you'd like
No error when passing expected objects whose type matches that of the actual object.
Is your feature request related to a problem? Please describe.
If you have two typed objects,
actual
andexpect
, of the same type,assertObjectMatch
doesn't let you use the expect object:Describe the solution you'd like
No error when passing expected objects whose type matches that of the actual object.
Describe alternatives you've considered
Asked on Discord ~a week ago, no replies yet.
The text was updated successfully, but these errors were encountered: