diff --git a/apps/oxlint/conformance/init.sh b/apps/oxlint/conformance/init.sh index 9e50eb6a8819b..868d955b8afe2 100755 --- a/apps/oxlint/conformance/init.sh +++ b/apps/oxlint/conformance/init.sh @@ -10,6 +10,7 @@ TESTING_LIBRARY_SHA="b8ef3772487a32c886cb5c338da2a144560a437b" # 7.15.4 STORYBOOK_SHA="99aa48989f6798ae24d9867bc2b5fe6991a2e341" # v10.3.0-alpha.12 PLAYWRIGHT_SHA="7e16bd565cfccd365a6a8f1f7f6fe29a1c868036" # v2.9.0 CYPRESS_SHA="de98a5de648694518873ad85b41250e40a67be95" # v6.2.0 +MOCHA_SHA="1e5a3a1a9597ab54e5cc3d3fc58071009d0335d3" # v11.1.0 # Shallow clone a repo at a specific commit, and `cd` into the cloned directory. # Git commands copied from `.github/scripts/clone-parallel.mjs`. @@ -244,3 +245,16 @@ npm install # Return to `submodules` directory cd .. + +############################################################################### +# Mocha +############################################################################### + +# Clone `eslint-plugin-mocha` repo into `submodules/mocha` +clone mocha https://github.com/lo1tuma/eslint-plugin-mocha.git "$MOCHA_SHA" + +# Install dependencies +npm install + +# Return to `submodules` directory +cd .. diff --git a/apps/oxlint/conformance/snapshots/mocha.md b/apps/oxlint/conformance/snapshots/mocha.md new file mode 100644 index 0000000000000..b59def13f0c1f --- /dev/null +++ b/apps/oxlint/conformance/snapshots/mocha.md @@ -0,0 +1,54 @@ +# Conformance test results - mocha + +## Summary + +### Rules + +| Status | Count | % | +| ----------------- | ----- | ------ | +| Total rules | 24 | 100.0% | +| Fully passing | 24 | 100.0% | +| Partially passing | 0 | 0.0% | +| Fully failing | 0 | 0.0% | +| Load errors | 0 | 0.0% | +| No tests run | 0 | 0.0% | + +### Tests + +| Status | Count | % | +| ----------- | ----- | ------ | +| Total tests | 825 | 100.0% | +| Passing | 825 | 100.0% | +| Failing | 0 | 0.0% | +| Skipped | 0 | 0.0% | + +## Fully Passing Rules + +- `consistent-interface` (9 tests) +- `consistent-spacing-between-blocks` (17 tests) +- `handle-done-callback` (42 tests) +- `max-top-level-suites` (37 tests) +- `no-async-suite` (16 tests) +- `no-empty-title` (51 tests) +- `no-exclusive-tests` (44 tests) +- `no-exports` (31 tests) +- `no-global-tests` (40 tests) +- `no-hooks-for-single-case` (35 tests) +- `no-hooks` (29 tests) +- `no-identical-title` (28 tests) +- `no-mocha-arrows` (26 tests) +- `no-nested-tests` (20 tests) +- `no-pending-tests` (45 tests) +- `no-return-and-callback` (44 tests) +- `no-return-from-async` (27 tests) +- `no-setup-in-describe` (65 tests) +- `no-sibling-hooks` (32 tests) +- `no-synchronous-tests` (45 tests) +- `no-top-level-hooks` (31 tests) +- `prefer-arrow-callback` (67 tests) +- `valid-suite-title` (17 tests) +- `valid-test-title` (27 tests) + +## Rules with Failures + +No rules with failures diff --git a/apps/oxlint/conformance/src/groups/index.ts b/apps/oxlint/conformance/src/groups/index.ts index 74973b5a15e47..994a608fd3dcd 100644 --- a/apps/oxlint/conformance/src/groups/index.ts +++ b/apps/oxlint/conformance/src/groups/index.ts @@ -9,6 +9,7 @@ import testingLibrary from "./testing_library.ts"; import storybook from "./storybook.ts"; import playwright from "./playwright.ts"; import cypress from "./cypress.ts"; +import mocha from "./mocha.ts"; export const TEST_GROUPS: TestGroup[] = [ eslint, @@ -20,4 +21,5 @@ export const TEST_GROUPS: TestGroup[] = [ storybook, playwright, cypress, + mocha, ]; diff --git a/apps/oxlint/conformance/src/groups/mocha.ts b/apps/oxlint/conformance/src/groups/mocha.ts new file mode 100644 index 0000000000000..6ea362a1c7030 --- /dev/null +++ b/apps/oxlint/conformance/src/groups/mocha.ts @@ -0,0 +1,19 @@ +import type { TestGroup } from "../index.ts"; + +const group: TestGroup = { + name: "mocha", + + submoduleName: "mocha", + testFilesDirPath: "source/rules", + + transformTestFilename(filename: string) { + if (!filename.endsWith(".test.ts")) return null; + return filename.slice(0, -".test.ts".length); + }, + + ruleTesters: [{ specifier: "eslint", propName: "RuleTester" }], + + parsers: [], +}; + +export default group;