eslint-plugin-jasmine
eslint-plugin-jasmine copied to clipboard
`new-line-before-expect` not ignoring earlier `expect`
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
I can confirm this one as well. It is quite annoying! I believe it only happens when an expect
spans multiple lines.

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
Probably same reason as #161, everything that is not a line starting with expect(
is invalid.
Issue 161 states that fix was released in version 4.1.3. I am using that version and the issue described here definitely remains.