Skip to content

Commit

Permalink
test: modify how tests files all the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Jul 26, 2023
1 parent 72ac135 commit 7cfdeb0
Show file tree
Hide file tree
Showing 59 changed files with 349 additions and 320 deletions.
22 changes: 22 additions & 0 deletions tests/rules/functional-parameters/es2015/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
name,
rule,
} from "#eslint-plugin-functional/rules/functional-parameters";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import es3Invalid from "../es3/invalid";
import es3Valid from "../es3/valid";

import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid: [...es3Valid, ...valid],
invalid: [...es3Invalid, ...invalid],
};

const tester = testRule(name, rule);

tester.typescript(tests);
tester.esLatest(tests);
tester.es2015(tests);
7 changes: 0 additions & 7 deletions tests/rules/functional-parameters/es2015/index.ts

This file was deleted.

19 changes: 19 additions & 0 deletions tests/rules/functional-parameters/es3/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
name,
rule,
} from "#eslint-plugin-functional/rules/functional-parameters";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid,
invalid,
};

const tester = testRule(name, rule);

tester.typescript(tests);
tester.esLatest(tests);
tester.es3(tests);
7 changes: 0 additions & 7 deletions tests/rules/functional-parameters/es3/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions tests/rules/functional-parameters/index.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { name, rule } from "#eslint-plugin-functional/rules/immutable-data";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import tsTests from "./ts";
import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid,
invalid,
};

const tester = testRule(name, rule);

tester.typescript(tsTests);
tester.typescript(tests);
7 changes: 0 additions & 7 deletions tests/rules/immutable-data/ts/array/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions tests/rules/immutable-data/ts/index.ts

This file was deleted.

14 changes: 14 additions & 0 deletions tests/rules/immutable-data/ts/object/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { name, rule } from "#eslint-plugin-functional/rules/immutable-data";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid,
invalid,
};

const tester = testRule(name, rule);

tester.typescript(tests);
7 changes: 0 additions & 7 deletions tests/rules/immutable-data/ts/object/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { name, rule } from "#eslint-plugin-functional/rules/no-classes";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import es6Tests from "./es2015";
import invalid from "./invalid";
import valid from "./valid";

const tester = testRule(name, rule);

tester.typescript(es6Tests);
const tests = {
valid,
invalid,
};

tester.esLatest(es6Tests);
const tester = testRule(name, rule);

tester.es2015(es6Tests);
tester.typescript(tests);
tester.esLatest(tests);
tester.es2015(tests);
7 changes: 0 additions & 7 deletions tests/rules/no-class/es2015/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ import {
} from "#eslint-plugin-functional/rules/no-conditional-statements";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import tsTests from "./ts";
import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid,
invalid,
};

const tester = testRule(name, rule);

tester.typescript(tsTests);
tester.typescript(tests);
7 changes: 0 additions & 7 deletions tests/rules/no-conditional-statement/ts/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ import {
} from "#eslint-plugin-functional/rules/no-expression-statements";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import tsTests from "./ts";
import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid,
invalid,
};

const tester = testRule(name, rule);

tester.typescript(tsTests);
tester.typescript(tests);
7 changes: 0 additions & 7 deletions tests/rules/no-expression-statement/ts/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { name, rule } from "#eslint-plugin-functional/rules/no-let";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import es6Tests from "./es2015";
import invalid from "./invalid";
import valid from "./valid";

const tester = testRule(name, rule);

tester.typescript(es6Tests);
const tests = {
valid,
invalid,
};

tester.esLatest(es6Tests);
const tester = testRule(name, rule);

tester.es2015(es6Tests);
tester.typescript(tests);
tester.esLatest(tests);
tester.es2015(tests);
7 changes: 0 additions & 7 deletions tests/rules/no-let/es2015/index.ts

This file was deleted.

19 changes: 19 additions & 0 deletions tests/rules/no-loop-statement/es2015/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { name, rule } from "#eslint-plugin-functional/rules/no-loop-statements";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import es3Invalid from "../es3/invalid";
import es3Valid from "../es3/valid";

import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid: [...es3Valid, ...valid],
invalid: [...es3Invalid, ...invalid],
};

const tester = testRule(name, rule);

tester.typescript(tests);
tester.esLatest(tests);
tester.es2015(tests);
7 changes: 0 additions & 7 deletions tests/rules/no-loop-statement/es2015/index.ts

This file was deleted.

16 changes: 16 additions & 0 deletions tests/rules/no-loop-statement/es3/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { name, rule } from "#eslint-plugin-functional/rules/no-loop-statements";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid,
invalid,
};

const tester = testRule(name, rule);

tester.typescript(tests);
tester.esLatest(tests);
tester.es2015(tests);
7 changes: 0 additions & 7 deletions tests/rules/no-loop-statement/es3/index.ts

This file was deleted.

17 changes: 0 additions & 17 deletions tests/rules/no-loop-statement/index.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { name, rule } from "#eslint-plugin-functional/rules/no-mixed-types";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import tsTests from "./ts";
import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid,
invalid,
};

const tester = testRule(name, rule);

tester.typescript(tsTests);
tester.typescript(tests);
7 changes: 0 additions & 7 deletions tests/rules/no-mixed-type/ts/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { name, rule } from "#eslint-plugin-functional/rules/no-promise-reject";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import es6Tests from "./es2015";
import invalid from "./invalid";
import valid from "./valid";

const tester = testRule(name, rule);

tester.typescript(es6Tests);
const tests = {
valid,
invalid,
};

tester.esLatest(es6Tests);
const tester = testRule(name, rule);

tester.es2015(es6Tests);
tester.typescript(tests);
tester.esLatest(tests);
tester.es2015(tests);
7 changes: 0 additions & 7 deletions tests/rules/no-promise-reject/es2015/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { name, rule } from "#eslint-plugin-functional/rules/no-return-void";
import { testRule } from "#eslint-plugin-functional/tests/helpers/testers";

import tsTests from "./ts";
import invalid from "./invalid";
import valid from "./valid";

const tests = {
valid,
invalid,
};

const tester = testRule(name, rule);

tester.typescript(tsTests);
tester.typescript(tests);
7 changes: 0 additions & 7 deletions tests/rules/no-return-void/ts/index.ts

This file was deleted.

0 comments on commit 7cfdeb0

Please sign in to comment.