Comments (7)
Here is a first pass at bringing over the tests from node:
https://github.com/jessetane/buffer/tree/copy-over-node-buffer-tests
I'm not sure if the technique is exactly what you had in mind, but it does have the advantage of making updates somewhat automatable.
There is one change needed for the base64 tests to pass that I thought might be more appropriate in the dependency, you can see the patch here.
The changes include a fix for #48, but there are still a couple slight differences that node's tests don't pick up - I've left some comments here.
from buffer.
added some commits to try transforming node's tests to use tape instead of assert - they almost all pass in the browser now, but they're much slower.
running the tests with npm seems to run the process out of memory, although tape test/*.js
seems to work.
from buffer.
@jessetane Looking good! Maybe we can comment out the stress tests for now if they're causing issues. It would be great just to have the rest of them for now.
from buffer.
Ok, looks like the failures were mostly related to object mode - seems to be working now.
Node's tests just do a huge number of iterations in loops so when using tape they still do take quite a while - around 40 seconds or so when testing both typed and non-typed in one go - do you think that's an unacceptably long time?
from buffer.
40 seconds is fine. If it really becomes an issue we can reduce the number of iterations or move the tests to a stress/
folder that can be run manually instead of every Travis build and npm test
run.
Can you send a PR? Excited to get these merged in! Thanks for the awesome work!
from buffer.
Done. I added the base64 url-safe fix here so the tests pass, if/when that lands in the dep we can take it out.
from buffer.
This was fixed by @jessetane in #51.
from buffer.
Related Issues (20)
- Property storage exceeds 196607 properties, js engine: hermes HOT 1
- Uncaught SyntaxError: Cannot use import statement outside a module HOT 1
- wrt: standalone script. HOT 3
- Buffer Lib does not transpile code into ES2015 which does not allow to import it by older devices HOT 1
- "File is not a constructor" in Node 16 and below HOT 2
- Buffer 4.9.2 refers to `global` which is a node-only feature. HOT 1
- [suggestion] Replace https://bundle.run/buffer with https://bundle.run/[email protected] HOT 1
- subarray returns Uint8Array which can't handle toString('uff-8') HOT 31
- Uncaught SyntaxError: Invalid or unexpected token (at VM9 [email protected]:1:2)
- Consider injecting Buffer to window in standalone script
- Publish new version to npm HOT 3
- ESM Support HOT 4
- if possible map it like filer-browserify?
- typing error on method concat with TS 5.3
- Remove dependency on `base64-js` HOT 20
- Missing alias for writeBigUint64BE / LE HOT 2
- Remove exclamation mark in header comment HOT 1
- Why is the code above version 6.0 ES6? This leads to errors running on lower versions of browsers HOT 1
- entire library won't work if BigInt syntax is unsupported
- [bug] Unknown encoding: base64url HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buffer.