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

False positive warning on Spy declared outside of before/after/it block #344

Open
guoliang opened this issue Dec 22, 2021 · 0 comments
Open
Labels

Comments

@guoliang
Copy link

Describe the bug

The following snippet gives me the following lint warning

Spy declared outside of before/after/it block

const setupMockComponents = () => {
		componentInstanceDatagrid = {
			id: "compId4",
			displayName: "Component four",
			typedef: "Datagrid",
			datasource: "some datasource",
			getId: jasmine.createSpy("getId").and.returnValue("compId4"),
			getDatabearer: jasmine.createSpy("getDatabearer").and.returnValue(datagridDatabearer),
			getTypedef: jasmine.createSpy("getTypedef").and.returnValue("Datagrid"),
			refreshComponent: () => {},
			getBoundarySetting: jasmine.createSpy("getBoundarySetting").and.returnValue({}),
			updateBindings: jasmine.createSpy("updateBindings"),
		};
	};
	beforeEach(() => {
		setupMockComponents();
	});

Should this be okay? or I shouldn't declare spies like so?

Context

  • Node.js version: v14
  • eslint-plugin-jasmine version: 4.1.3
  • eslint version: 7.32.0
  • Operating system: win10
@guoliang guoliang added the bug label Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant