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

Commit f896344

Browse files
committed
test: make tests independent of the project eslint config
1 parent 94f87f5 commit f896344

File tree

9 files changed

+19
-8
lines changed

9 files changed

+19
-8
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
"rules": {
3+
"indent": ["error", 2],
4+
"no-undef": "error",
5+
"no-console": "off",
6+
"semi": [
7+
"error",
8+
"never"
9+
],
10+
}
11+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

spec/linter-eslint-spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import { processESLintMessages } from '../dist/helpers'
1111
const fixturesDir = path.join(__dirname, 'fixtures')
1212

1313
const paths = {
14-
good: path.join(fixturesDir, 'files', 'good.js'),
15-
bad: path.join(fixturesDir, 'files', 'bad.js'),
16-
badInline: path.join(fixturesDir, 'files', 'badInline.js'),
17-
empty: path.join(fixturesDir, 'files', 'empty.js'),
18-
fix: path.join(fixturesDir, 'files', 'fix.js'),
19-
cache: path.join(fixturesDir, 'files', '.eslintcache'),
14+
good: path.join(fixturesDir, 'files', 'with-config', 'good.js'),
15+
bad: path.join(fixturesDir, 'files', 'with-config', 'bad.js'),
16+
badInline: path.join(fixturesDir, 'files', 'inline', 'badInline.js'),
17+
empty: path.join(fixturesDir, 'files', 'with-config', 'empty.js'),
18+
fix: path.join(fixturesDir, 'files', 'with-config', 'fix.js'),
19+
cache: path.join(fixturesDir, 'files', 'with-config', '.eslintcache'),
2020
config: path.join(fixturesDir, 'configs', '.eslintrc.yml'),
2121
ignored: path.join(fixturesDir, 'eslintignore', 'ignored.js'),
2222
endRange: path.join(fixturesDir, 'end-range', 'no-unreachable.js'),

spec/worker-helpers-spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ describe('Worker Helpers', () => {
183183
})
184184

185185
it('returns the path relative to the project dir if provided when no ignore file is found', async () => {
186-
const fixtureFile = getFixturesPath(Path.join('files', 'good.js'))
186+
const fixtureFile = getFixturesPath(Path.join('files', 'with-config', 'good.js'))
187187
// Copy the file to a temporary folder
188188
const filePath = await copyFileToTempDir(fixtureFile)
189189
const tempDir = Path.dirname(filePath)
@@ -200,7 +200,7 @@ describe('Worker Helpers', () => {
200200
})
201201

202202
it('returns just the file being linted if no ignore file is found and no project dir is provided', async () => {
203-
const fixtureFile = getFixturesPath(Path.join('files', 'good.js'))
203+
const fixtureFile = getFixturesPath(Path.join('files', 'with-config', 'good.js'))
204204
// Copy the file to a temporary folder
205205
const filePath = await copyFileToTempDir(fixtureFile)
206206
const tempDir = Path.dirname(filePath)

0 commit comments

Comments
 (0)