Why does Jest logs `TypeError: decode[type] is not a function` error while testing ?

Game
✕ Should connect (8003 ms)

● Game › Should connect

TypeError: decode[type] is not a function

  at decodePrimitiveType (node_modules/@colyseus/schema/src/Schema.ts:109:34)
  at _.Object.<anonymous>.Schema.decode (node_modules/@colyseus/schema/src/Schema.ts:352:25)
  at SchemaSerializer.Object.<anonymous>.SchemaSerializer.setState (node_modules/colyseus.js/src/serializer/SchemaSerializer.ts:10:20)
  at Room.Object.<anonymous>.Room.setState (node_modules/colyseus.js/src/Room.ts:225:25)

could you upload a piece of code that throw ing errors? Thanks.