Getting TypeError: this is not a typed array using Buffer.from in mocha
<p>I'm using Mocha / Chai to unit test a library that has recently started using nodejs' Buffer objects to solve a different problem.</p>

<p>I get this error message in the unit test:</p>

<pre><code>TypeError: this is not a typed array. 
at Function.from (native) 
at Object.hashesMatch (index.js:29:18
at Context.&lt;anonymous&gt; (test/test.js:25:22)
</code></pre>

<p>Line 29 of index.js is where I'm using nodejs' Buffer...</p>

<pre><code>var b = Buffer.from ('some string or other');
</code></pre>

<p>I can't find a polyfill or workaround so would be grateful for suggestions.</p>

<p>Thanks</p>