Code Monkey home page Code Monkey logo

Comments (3)

ivoanjo avatar ivoanjo commented on September 28, 2024

👍 I also run into this issue -- I copy pasted my test code in the describes while experimenting with the library, but then was seeing that no tests run on the output, which was a bit confusing.

from specnaz.

skinny85 avatar skinny85 commented on September 28, 2024

I've done some research on this topic, and what I found is that the behavior is different between JUnit and TestNG.

The following code:

import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public class ExampleTest {
}

fails a build with a "no runnable methods" error - the BlockJUnit4ClassRunner validates whether a class has any test methods (see code here).

However, this code:

import org.testng.annotations.Test;

@Test
public class ExampleTest {
}

works completely fine in TestNG, and does not cause the build to fail.

I think the Specnaz integrations should behave similarly to the framework their integrating with - so, my instinct is to fail the build in the JUnit Runner if no tests were found, but ignore it in the TestNG Factory.

Thoughts on this approach?

from specnaz.

Related Issues (10)

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.