Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Use buffer-loader for tests #62

Merged
merged 2 commits into from
Jan 28, 2016

Conversation

fbaiodias
Copy link
Member

I implemented a simple buffer-loader based on the binary-loader which fixes the two missing tests.

However I got a weird bug with webpack as it doesn't seem to define Buffer if it is not used outside the tests, so I added an hack on top of the file.
@dignifiedquire do you have any idea how to avoid this?

@daviddias
Copy link
Member

@xicombd the buffer thing is weird indeed. Did you tried with the WebPack version that uses node-libs 1.0.0?

@fbaiodias
Copy link
Member Author

Tried with latest webpack and with your fork, and neither seem to work 😟

@dignifiedquire
Copy link
Member

@xicombd take a look at this page: http://webpack.github.io/docs/how-to-write-a-loader.html#mark-dependencies you might have to flag Buffer explicitly as a dependency in your loader

@fbaiodias
Copy link
Member Author

@dignifiedquire hum, that doesn't seem to be the problem as it loads the file properly, and I can log the buffer size correctly. The problem is that Buffer isn't defined on the browser context, what makes the two tests that use it fail:
screen shot 2016-01-28 at 13 09 38

@dignifiedquire
Copy link
Member

@xicombd looks like I found a bug in webpack: webpack/webpack#1944

@fbaiodias
Copy link
Member Author

@dignifiedquire Oh, nice catch! That explains it, I'll change my PR to use regular functions in the meanwhile then. Thanks!

@daviddias
Copy link
Member

👍 @dignifiedquire :D @xicombd wanna update the PR?

@fbaiodias
Copy link
Member Author

@diasdavid done!

@daviddias
Copy link
Member

rad! thank you :)

daviddias added a commit that referenced this pull request Jan 28, 2016
@daviddias daviddias merged commit 371efda into ipfs:update/ipfs-repo Jan 28, 2016
@fbaiodias fbaiodias deleted the use-buffer-loader branch January 28, 2016 14:19
vasco-santos pushed a commit that referenced this pull request Sep 21, 2021
Bumps [file-type](https://github.com/sindresorhus/file-type) from 15.0.1 to 16.0.0.
- [Release notes](https://github.com/sindresorhus/file-type/releases)
- [Commits](sindresorhus/file-type@v15.0.1...v16.0.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants