Code Monkey home page Code Monkey logo

Comments (7)

jessetane avatar jessetane commented on August 20, 2024

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.

jessetane avatar jessetane commented on August 20, 2024

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.

feross avatar feross commented on August 20, 2024

@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.

jessetane avatar jessetane commented on August 20, 2024

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.

feross avatar feross commented on August 20, 2024

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.

jessetane avatar jessetane commented on August 20, 2024

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.

feross avatar feross commented on August 20, 2024

This was fixed by @jessetane in #51.

from buffer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.