Comments (7)
Interesting scenario, thanks for creating an issue on this. Will look at it in the near future.
from pester.
I agree with this.
from pester.
In terms of implementation, it would be much easier to output one message and then ignore the rest of the current Context
(or Describe
, if the error happens within that scope), than it would be to try to output messages for each subsequent skipped test.
What would be the value of having all of the tests that weren't executed in the output? If it's worth the development effort, then it could certainly be done. Also, what would be the proper behavior if an error occurs in a Describe
which contains one or more Context
statements? Should the aborted Context
statements and the It
statements they contain be output as well?
from pester.
For CI jobs it would be handy if Pester could exit with a non-zero exit code if an exception is thrown from a Context (assuming it was invoked with -EnableExit). Currently it exits with code 0 as long as all tests that could run have passed.
Counting the exact number of skipped tests is probably less important than reporting that there were errors. Just for reference I looked into what JUnit does when a @BeforeClass
method fails - it reports a single error and doesn't bother counting the individual @Test
s it missed.
from pester.
That should be pretty easy to do. I'll look into it this week.
from pester.
Just opened a very basic PR to accomplish this, to give us something concrete to talk about. There may be improvements to be made here. (For instance, the code that parses BeforeEach
/ AfterEach
blocks inside a Describe
would still terminate the whole script in the "old way" if there's a syntax error; that could be moved into the Try
block to produce a failed test instead.)
from pester.
Merged the PR which turns a terminating error in a Describe
or Context
into a single failed test (in addition to whatever else already happened in that block prior to the error.) This will be part of the upcoming v3.0 release.
from pester.
Related Issues (20)
- v5.5 $____Pester.CurrentTest not populated in AfterEach HOT 4
- Missing timestamp from test suite attributes in junit xml export HOT 1
- Unbound container scriptblock unexpectedly runs in Pester scope HOT 10
- Pester 5.5 reports incorrect Skipped results for Pending and Inconclusive HOT 3
- BeOfType doesn't see types, loaded from a file with classes, but the "It" function - does HOT 3
- Refer to a script in a parent directory HOT 2
- Does somthing like @afterstep exist for Pester 4.6 with Invoke Gherkin HOT 1
- New-RandomTempRegistry: Test-Path : No more data is available HOT 2
- Provide a way to more easily modify a mocked parameter before comparing with a test value. HOT 3
- Error during handling of output-element within Write-NUnit3OutputElement HOT 1
- SkipRemainingOnFailure does not function correctly when there are nested BeforeAll blocks HOT 4
- Support shuffling / randomized test runs HOT 7
- Templates in test names do not expand variables when skipped HOT 8
- Add test count to minimal view HOT 4
- Remove -Pending from Set-ItResult HOT 2
- Remove legacy Should Syntax
- Certificate warning when upgrading to 5.6.0-beta1 HOT 1
- Block setup and teardown executed when tests are skipped HOT 4
- SkipRemainingOnFailure reports skipped on filtered and explicitly skipped tests
- $configuration.CodeCoverage.UseBreakpoints = to false by default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pester.