Getting TypeError: this is not a typed array using Buffer.from in mocha

前端 未结 3 983
心在旅途
心在旅途 2020-12-17 09:04

I\'m using Mocha / Chai to unit test a library that has recently started using nodejs\' Buffer objects to solve a different problem.

I get this error message in the

3条回答
  •  我在风中等你
    2020-12-17 09:40

    I also got the same error. You can try this

    var b = new Buffer('some string or other');
    

    Second param is encoding (optional). By default encoding will be utf-8

提交回复
热议问题