Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated setUp() with TestCase inheritance #31

Open
thomaskoehn-kisi opened this issue Oct 3, 2018 · 1 comment
Open

Repeated setUp() with TestCase inheritance #31

thomaskoehn-kisi opened this issue Oct 3, 2018 · 1 comment

Comments

@thomaskoehn-kisi
Copy link

Let's call it rather a question than an issue – not sure if it is intended or not. I have:

// file ATestCase
class ATestCase extends ImpTestCase {
  setUp() { some code }
}
class BTestCase extends ATestCase {
  testSomething() { some code }
}

when I run impt test with ATestCase::testSomething, the order of execution is:

  • BTestCase::setUp
  • BTestCase::testSomething
  • ATestCase::setUp

I am confused why ATestCase::setUp is called, don't really want it – and would think it is incorrect (especially at that point in time).

@thomaskoehn-kisi
Copy link
Author

...ok, so if I run ATestCase:BTestCase::testSomething, the result is what I expect:

  • BTestCase::setUp
  • BTestCase::testSomething

also just tested: it is not a problem that the file and first class have the same name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant