Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit fffa3b3

Browse files
committed
test: fix the test for global eslint
1 parent d1babbb commit fffa3b3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

spec/worker-helpers-spec.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,13 @@ describe('Worker Helpers', () => {
120120
})
121121

122122
it('cries if global eslint is not found', () => {
123-
expect(() => {
124-
const config = createConfig({
125-
global: { useGlobalEslint: true, globalNodePath: getFixturesPath('files') }
126-
})
127-
Helpers.getESLintInstance(getFixturesPath('local-eslint'), config)
128-
}).toThrow()
123+
const config = createConfig({
124+
global: { useGlobalEslint: true, globalNodePath: getFixturesPath('files') }
125+
})
126+
spyOn(console, 'error')
127+
Helpers.getESLintInstance(getFixturesPath('local-eslint'), config)
128+
expect(console.error).toHaveBeenCalledWith(`Global ESLint is not found, please ensure the global Node path is set correctly.
129+
If you wanted to use a local installation of Eslint, disable Global Eslint option in the linter-eslint config.`)
129130
})
130131

131132
it('tries to find a local eslint with nested node_modules', () => {

0 commit comments

Comments
 (0)