GithubHelp home page GithubHelp logo

blue-tape vs. mocha about dendritic HOT 6 CLOSED

prismatik avatar prismatik commented on July 28, 2024
blue-tape vs. mocha

from dendritic.

Comments (6)

nwinch avatar nwinch commented on July 28, 2024

From #32:

We could, though, look at the number of things that depend on Tape vs the things that depend on Mocha and decide whether the gulf is so vast that it's an obvious choice.

@davidbanham Do you mean "things" internally? Or we talking community wide?

I think we should roll with Mocha as we never had any problems with it as far as I know? It felt like Tape came out swinging and we used it on a couple of projects, but pretty quickly went back to using Mocha for a variety of reasons. I don't think Tape is bad, it was kinda cool to use on a couple of projects - it's really minimal, that's cool - but it did seem like the internet was arguing about Mochas global vars/functions etc.. when I don't remember them being a problem?

Another discussion that kinda gets lost in this, is using fluent assertions. I love em. Yeah assert does the job, but it's more taxing to read down a page and find what's being asserted - you've gotta read through each line of code to get the context you need to understand why assert(obj1 == result). Easier understood as obj.must.be.true().

from dendritic.

davidbanham avatar davidbanham commented on July 28, 2024

I'm talking community wide.

The Problem With Mocha that caused me to go to Tape in the first place is how much of a sackpain it is to compose it with things like istanbul.

They both want to control the binary that runs things. With enough dicking around with gulp and/or command line flags you can make them play nicely with each other, but it takes some doing.

I shudder to think what would happen if you tried to make babel-node do it's thing in there too.

The crux is that control of the root level binary is a powerful tool, but it's a big hassle when multiple things demand to use it. Any time we can jettison a tool that wants it in favour of one that doesn't, we should take a good hard look.

That said, it seems to have transpired that the pain of Tape'ing is worse than the pain of smashing Mocha into Istanbul into Babel and picking through the wreckage.

Another discussion that kinda gets lost in this, is using fluent assertions. I love em. Yeah assert does the job, but it's more taxing to read down a page and find what's being asserted - you've gotta read through each line of code to get the context you need to understand why assert(obj1 == result). Easier understood as obj.must.be.true().

I find the exact opposite. I like that assert has a nice simple syntax that's unambiguous. In your example it would actually be assert(obj1) as equivalent to obj1.must.be.true()

Or potentially:

assert.deepEqual(obj1, result) and obj1.must.eq(result)

Either way, they both capture exactly the same amount of information in a single line, requiring the same amount of spelunking through the state of the rest of the function.

Assert, however, does it without monkeypatching the global prototype of All The Things. It's also part of stdlib, so it's one less (or in the case of must, 8 less, http://npm.anvaka.com/#/view/2d/must) vector by which we can be left-padded.

from dendritic.

kaievns avatar kaievns commented on July 28, 2024

i think it's worth separating the test runner and assertions libs discussions. chaijs can give you any style you like. or you can bring your own. i find that's one of the strengths of mocha as it doesn't lock you in with a specific assertions library.

i personally like mocha because it provides me with a robust and standard BDD interface for tests. I know what to do with it and when I'm done, i'm 99% sure that the next dev will know what to do with it as well.

as for bundling mocha with istanbul, it might be confusing a bit, but it is solvable in 100% of cases, with babel or without. I do it all the time. Just ask and I'll give you a working solution.

from dendritic.

davidbanham avatar davidbanham commented on July 28, 2024

I've done it before too, so I know it's possible. It's just such a pain in the neck. If there was another test framework that was equally productive that didn't demand a binary, I wanted to use it. I thought Tape might be that, but it turns out not to be. C'est la vie. Tape is dead. Long live Mocha.

from dendritic.

kaievns avatar kaievns commented on July 28, 2024

i don't really see the pain tbh. it's just an one line in your "scripts" section.

besides we're building a generator, right? we solve it once here and then every time someone generates a new project it will be automatically setup for them :)

from dendritic.

nwinch avatar nwinch commented on July 28, 2024

Bye Tape. I guess you just didn't stick.

from dendritic.

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.