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

new-line-before-expect not ignoring earlier expect #170

Open
briandipalma opened this issue Oct 17, 2018 · 4 comments
Open

new-line-before-expect not ignoring earlier expect #170

briandipalma opened this issue Oct 17, 2018 · 4 comments

Comments

@briandipalma
Copy link

briandipalma commented Oct 17, 2018

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

The second expect raises a new-line-before-expect warning:

    expect(blockTradeService.cancelQuote).toHaveBeenCalledWith({
      blockId,
      sendClientClose: true
    });
    expect(next).toHaveBeenCalled();

If the current behavior is a bug, please provide the steps to reproduce.

Code above.

What is the expected behavior?

Based on this documentation (also common sense): https://github.com/tlvince/eslint-plugin-jasmine/blob/master/docs/rules/new-line-before-expect.md (last example) no warning.

Please mention your node.js, eslint-plugin-jasmine and operating system version.

node: v10.5.0
eslint-plugin-jasmine: 2.10.1
MacOS: 10.12.6

@mikegreiling
Copy link

I can confirm this one as well. It is quite annoying! I believe it only happens when an expect spans multiple lines.

screen shot 2018-10-26 at 1 15 22 pm

@ovanderzee
Copy link

I see this bug too, with multiline expect statements like these two times:

        expect(spyConsoleWarn).toHaveBeenCalledWith(
            `inactivityListener rejected unknown-event`,
        )
        expect(spyConsoleWarn).toHaveBeenCalledWith(
            `inactivityListener rejected useless-event`,
        )
        expect(spyAddition).toHaveBeenCalledTimes(0)

eslint-plugin-jasmine: 4.1.1
eslint: 7.15.0
node: 12.18.0
npm: 6.14.4

@tva-TIS
Copy link

tva-TIS commented Mar 19, 2021

Probably same reason as #161, everything that is not a line starting with expect( is invalid.

@bojingo
Copy link

bojingo commented Nov 14, 2022

Issue 161 states that fix was released in version 4.1.3. I am using that version and the issue described here definitely remains.

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

5 participants