Git Product home page Git Product logo

Comments (5)

wokalski avatar wokalski commented on August 23, 2024 1

I created a mock PR

from zora.

lorenzofox3 avatar lorenzofox3 commented on August 23, 2024

That is a good idea. The only caveat I see is that there would not be any feedback at all before all the tests have finished. We could add some loading placeholder though.

In your case, as you load the test files by yourself (through your framework) and as pta does not do much more, I believe the easier would be to build your "own test-runner". That's pretty easy: pta itself is only few lines of code.

You could get something like:

import {
    createDiffReporter,
} from 'zora-reporters';

(async () => {
    // loading zora to hold the singleton:
    const { hold, report } = await import('path/to/zora/file/used/in/your/suites'); // 'zora/es' would likely be enough in you case
    hold();
    
    // Here using your framework
    await loadFiles()
    
    // now reporting
    await report({
        reporter: createDiffReporter(),
    });
})();

Let me know how it goes

from zora.

wokalski avatar wokalski commented on August 23, 2024

I think this is not the optimal solution to this. Adds another tight coupling where it's not really needed.

It's been some time since I used those features but if you used an async iterator for test reporting instead of simply pushing to an array. You would register tests dynamically through the execution. It would be fully compatible with all frameworks and all approaches. There are basically two conditions to resolve async next():

  1. A test is discovered
  2. beforeExit is called.

https://github.com/repeaterjs/repeater could be used to create the iterator.

from zora.

lorenzofox3 avatar lorenzofox3 commented on August 23, 2024

🤔 I am not sure to understand, would mind providing a PR ? Zora uses already async iterables.

Probably easier: would you mind sharing a reproduction of your setup which causes the problem ?

from zora.

lorenzofox3 avatar lorenzofox3 commented on August 23, 2024

Thanks, I have left a comment (I am not convinced this would solve the problem). It would be great if you could share an example of a test suite which reproduces the problem so I can eventually provide a solution

from zora.

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.