Coder Social home page Coder Social logo

Running a single test about frisby HOT 10 CLOSED

vlucas avatar vlucas commented on August 29, 2024
Running a single test

from frisby.

Comments (10)

vlucas avatar vlucas commented on August 29, 2024

As far as I know, there is no easy way to do this with the jasmine-node test runner and Frisby.js, but it is something I too have always wanted.

from frisby.

dsawardekar avatar dsawardekar commented on August 29, 2024

I did some further investigation into this. I found jasmine-only which does the job. It adds a describe.only and it.only like mocha, which runs only that test.

I noticed that Frisby writes dynamic describe and it calls. The next step is to make frisby also support the only syntax. I'm thinking if toss is passed 'only' as an argument it writes with a dynamic it.only or describe.only instead.

I'd be happy to make this PR, just need a couple of clarifications. In frisby.js, I was hoping to add an else check for retry == 'only' and then it = it.only or describe = describe.only. The it.results and current.it is confusing me.

Or maybe there is a better way. Can you clarify what would be the simplest way to pull this off?

from frisby.

vlucas avatar vlucas commented on August 29, 2024

Is there anything in Jasmine 2 that supports this? I will have to upgrade eventually anyways.

from frisby.

dsawardekar avatar dsawardekar commented on August 29, 2024

I don't think so. There are a couple of PR's that address this #309 and #181 but are unmerged. My feeling is this is seen as something that is to be provided by external plugins and is unlikely to make jasmine core.

from frisby.

vlucas avatar vlucas commented on August 29, 2024

Okay. Are we going to have to switch test runners away from jasmine-node as well to make this work?

from frisby.

dsawardekar avatar dsawardekar commented on August 29, 2024

@vlucas No. jasmine-node works fine with jasmine-only.

From Frisby's POV an extra jasmine-only dependency needs to be added to package.json to support this feature. Frisby could require jasmine-only within itself, so any test can use describe.only and it.only without manually requiring it in every test.

The issue is Frisby's dynamic describe and it declarations which need to be modified to conditionally use the only variants. My suggestion above was to do this via toss('only')

from frisby.

vlucas avatar vlucas commented on August 29, 2024

Right. That sounds like something that can be easily handled though. The dynamic creation of describe and it statements doesn't happen until the toss call, so yes - that would be the ideal place to put it.

from frisby.

katerberg avatar katerberg commented on August 29, 2024

@dsawardekar @vlucas Are you implementing this or is this an issue that is still unresolved?

from frisby.

dsawardekar avatar dsawardekar commented on August 29, 2024

@diablomarcus It's resolved for me at the moment. I ended up not needing single runs for the project I was working on at the time.

from frisby.

katerberg avatar katerberg commented on August 29, 2024

Thanks @vlucas!

from frisby.

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.