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
A common use case in testing is making sure an array contains an object with a given shape. This blog post discusses it. The code from the blog post works with Jet but fails with @std/expect. Example (with additional test) below.
Steps to Reproduce
import{test}from'@std/testing/bdd';import{expect}from'@std/expect';consta=[{foo: 'bar'},{foo: 'baz'},];test('matchObject on array',()=>{expect(a).toEqual(expect.arrayContaining([expect.objectContaining({foo: 'bar'}),]));});conststate=[{type: "START",data: "foo"},{type: "START",data: "baz"},{type: "END",data: "foo"},];test("test from blog post",()=>{expect(state).toEqual(// 1expect.arrayContaining([// 2expect.objectContaining({// 3type: "END",// 4}),]));});
A common use case in testing is making sure an array contains an object with a given shape. This blog post discusses it. The code from the blog post works with Jet but fails with
@std/expect
. Example (with additional test) below.Steps to Reproduce
Expected behavior
CodeSanbox
Environment
The text was updated successfully, but these errors were encountered: