expect(Buffer).to.be.a('Buffer') incorrectly fails
See original GitHub issueAs on tin, but best explained by example:
Test case:
it('should be a buffer', () => {
let buf = Buffer.alloc(0)
expect(buf).to.be.a('buffer')
})
result:
AssertionError: expected <Buffer > to be a buffer
env is a linux system, with the following:
$ node -v
v8.4.0
$ npm ls | grep chai
├─┬ chai@4.1.1
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
how to clean up the previous expect_buf in an expect script
I've determined empirically that unsetting the expect_out(buffer) is much more consistent than "expect *". This post was of great help for me.
Read more >What is a Buffer Overflow | Attack Types and Prevention Methods
Attackers exploit buffer overflow issues to change execution paths, triggering responses that can damage the applications and exposes private information.
Read more >Buffer Solutions - Cal State LA
Buffer Solutions ν Let's go back to problem of adding HCl to buffer solution: ν We can use H-H eqn. to make the...
Read more >Buffer Overflow Vulnerabilities, Exploits & Attacks - Veracode
Common application development mistakes that can lead to buffer overflow include failing to allocate large enough buffers and neglecting to check for overflow ......
Read more >Buffers
A buffer system can be made by mixing a soluble compound that contains the conjugate ... Although this step is not truly necessary...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@damianb btw you can workaround this by using the
instanceof
assertion@vieiralucas Thanks - ended up picking out that workaround myself after a little head scratching.
Figured it was worth still having the issue open, however - not sure if it merits further looking at, but that’s your team’s call.