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

Wrong line number is reported if fails not in main script file #80

Closed
AndrewSav opened this issue Nov 5, 2013 · 1 comment
Closed

Comments

@AndrewSav
Copy link

The line numbers is still out of wack in the latest nuget version (2.0.3). Powershell 3, Windows Server 2008 R2.

bla.Tests.ps1:

$here = Split-Path -Parent $MyInvocation.MyCommand.Path
    $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
    . "$here\$sut"

    Describe "bla" {

        It "does something useful" {
            Expect-Result $true $false "Stone flied"
        }
    }

bla.ps1:

# Empty
# Empty
# Empty
# Empty
# Empty
# Empty
# Empty
# Empty
# Empty
# Empty

function Expect-Result($expected, $actual, $text) {
    $actual | Should Be $expected
}

run pester, output is:

Executing all tests in C:\Andrew\pp\new-fixture
Describing bla
[-]   does something useful 192ms
   Expected: {True}, But was {False}
   at line: 18 in C:\Andrew\pp\new-fixture\bla.Tests.ps1
Tests completed in 192ms
Passed: 0 Failed: 1

The line number is apparently wrong.

@nohwnd
Copy link
Member

nohwnd commented Mar 4, 2014

Tested with the current version (2.0.4) and the error line is returned properly.

@nohwnd nohwnd closed this as completed Mar 4, 2014
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

2 participants