Skip to content

Commit

Permalink
chore: organize integration tests into folders
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbay committed Feb 12, 2022
1 parent a0d5570 commit ba8212e
Show file tree
Hide file tree
Showing 49 changed files with 86 additions and 87 deletions.
7 changes: 0 additions & 7 deletions src/tests/autofix.test.ts

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions src/tests/autofix/autofix.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import { noFooAllowed } from '../rules/no-foo-allowed'

runLintFixtureTests({
rule: noFooAllowed,
ruleName: 'autofix',
})
7 changes: 0 additions & 7 deletions src/tests/error-spans-single-test.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import { noFooAllowed } from '../rules/no-foo-allowed'

runLintFixtureTests({
rule: noFooAllowed,
ruleName: 'error-spans-single-test',
})
7 changes: 0 additions & 7 deletions src/tests/error-spans-tab-support.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import { noFooAllowed } from '../rules/no-foo-allowed'

runLintFixtureTests({
rule: noFooAllowed,
ruleName: 'error-spans-tab-support',
})
7 changes: 0 additions & 7 deletions src/tests/error-spans.test.ts

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions src/tests/error-spans/error-spans.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import { noFooAllowed } from '../rules/no-foo-allowed'

runLintFixtureTests({
rule: noFooAllowed,
ruleName: 'error-spans',
})
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { runLintFixtureTests } from '../ruleSnapshotTester'
import rule from './rules/camel-case-local-functions'
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import rule from '../rules/camel-case-local-functions'
import { join } from 'path'

runLintFixtureTests({
Expand Down
7 changes: 0 additions & 7 deletions src/tests/fixture-starting-with-whitespace.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP


exports[`should only have one test case when fixture starts with whitespace 1`] = `
"
function onlyOneTest() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import rule from '../rules/camel-case-local-functions'

runLintFixtureTests({
rule,
ruleName: 'fixture-starting-with-whitespace',
})
7 changes: 0 additions & 7 deletions src/tests/parse-errors.test.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/tests/readme.test.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions src/tests/readme/readme.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import { noFooAllowed } from '../rules/no-foo-allowed'

// will generate and run tests for you
runLintFixtureTests({
rule: noFooAllowed,
ruleName: 'readme',
})
7 changes: 0 additions & 7 deletions src/tests/rule-options-in-fixture.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import { noRestrictedImports } from '../rules/no-restricted-imports'

runLintFixtureTests({
rule: noRestrictedImports,
ruleName: 'rule-options-in-fixture',
})
File renamed without changes.
7 changes: 7 additions & 0 deletions src/tests/runtime-errors-parsing/parse-errors.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import { noFooAllowed } from '../rules/no-foo-allowed'

runLintFixtureTests({
rule: noFooAllowed,
ruleName: 'parse-errors',
})
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { runLintFixtureTests } from '../ruleSnapshotTester'
import rule from './rules/camel-case-local-functions'
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import rule from '../rules/camel-case-local-functions'

const consoleWarn = jest.spyOn(console, 'warn').mockImplementation(() => {})

runLintFixtureTests({
rule,
ruleName: 'unsupported-jsdoc',
ruleName: 'runtime-errors-unsupported-jsdoc',
})

it('should give a helpful warning when encountering an unsupported jsdoc tag in a fixture', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { runLintFixtureTests } from '../ruleSnapshotTester'
import rule from './rules/camel-case-local-functions'
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import rule from '../rules/camel-case-local-functions'

let consoleWarn: jest.SpyInstance

Expand Down Expand Up @@ -30,15 +30,15 @@ it('should give a helpful error when unable to locate a fixture', () => {
.replace(/\\/g, '/')

expect(message).toMatchInlineSnapshot(`
"could not find fixture for the rule my-rule-with-missing-fixture.
looked for:
my-rule-with-missing-fixture.fixture
my-rule-with-missing-fixture.fixture.[any extension]
"could not find fixture for the rule my-rule-with-missing-fixture.
looked for:
my-rule-with-missing-fixture.fixture
my-rule-with-missing-fixture.fixture.[any extension]
under the following directories:
/src/tests
/src/tests/__fixtures__"
`)
under the following directories:
/src/tests/runtime-errors
/src/tests/runtime-errors/__fixtures__"
`)
})

it('should give a helpful error when unable to parse rule options in a fixture', () => {
Expand Down
7 changes: 0 additions & 7 deletions src/tests/split-fixtures.test.ts

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions src/tests/split-fixtures/split-fixtures.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import rule from '../rules/camel-case-local-functions'

runLintFixtureTests({
rule,
ruleName: 'split-fixtures',
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { runLintFixtureTests } from '../../ruleSnapshotTester'
import rule from '../rules/camel-case-local-functions'

runLintFixtureTests({
rule,
ruleName: 'underscore-fixtures-directory',
})
7 changes: 0 additions & 7 deletions src/tests/underscore-fixtures-directory.test.ts

This file was deleted.

0 comments on commit ba8212e

Please sign in to comment.