Automattic / Automattic/expect.js
check if something is a buffer
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 207
- PR merge metrics
- No merged PRs in 30d
Description
Is there a way to check if something is a buffer?
``` javascript
expect(file).to.be.a('buffer') does not work.
```
Should has this functionality.
``` javascript
You can do file.should.be.instaceof(Buffer)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the JavaScript assertion entry point for `.a(...)` and its existing type checks; compare the requested `buffer` form with the `instanceof(Buffer)` workaround shown in the issue. Confirm the intended assertion syntax and add coverage for a Buffer value and a non-Buffer value; done means the requested check works without the workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100