miherlosev / eslint-plugin-testcafe

MIT License
15 stars 7 forks source link

Add new rules for no-debug, no-skip and no-only #9

Closed benmonro closed 4 years ago

benmonro commented 4 years ago

https://github.com/miherlosev/eslint-plugin-testcafe/issues/8

benmonro commented 4 years ago

@miherlosev added the 3 new rules. let me know when this can be merged and published as we could use it right away.

miherlosev commented 4 years ago

Hi @benmonro

Thank you a lot for your contribution. I cloned your PR and run tests. There is one problematic test. image

Please fix it.

benmonro commented 4 years ago

Can you please give me the full error messages you are getting? @miherlosev

miherlosev commented 4 years ago

C:\forks\for_review\master>npm run test

eslint-plugin-testcafe@0.2.1 test C:\forks\for_review\master jest

(node:17080) ExperimentalWarning: The fs.promises API is experimental (node:18104) ExperimentalWarning: The fs.promises API is experimental (node:1568) ExperimentalWarning: The fs.promises API is experimental (node:1164) ExperimentalWarning: The fs.promises API is experimental FAIL tests/index.test.js ● should have all the rules

expect(received).toMatchSnapshot()

Snapshot name: `should have all the rules 1`

- Snapshot  - 4
+ Received  + 4

@@ -2,11 +2,11 @@
    "no-debug": Object {
      "create": [Function],
      "meta": Object {
        "docs": Object {
          "category": "Mistake Prevention",
-         "description": "Don't allow debug() to be committed to the repository. ",
+         "description": "Don't allow `t.debug()` to be committed to the repository. ",
          "recommended": true,
        },
        "fixable": null,
        "schema": Array [],
      },
@@ -14,23 +14,23 @@
    "no-only": Object {
      "create": [Function],
      "meta": Object {
        "docs": Object {
          "category": "Mistake Prevention",
-         "description": "Don't allow test.only to be added to the repository",
-         "recommended": false,
+         "description": "Don't allow `test.only` to be added to the repository",
+         "recommended": true,
        },
        "fixable": null,
        "schema": Array [],
      },
    },
    "no-skip": Object {
      "create": [Function],
      "meta": Object {
        "docs": Object {
          "category": "Mistake Prevention",
-         "description": "Don't allow test.skip to be added to the repository",
+         "description": "Don't allow `test.skip` or `fixture.skip` to be added to the repository",
          "recommended": true,
        },
        "fixable": null,
        "schema": Array [],
      },

  2 | 
  3 | it("should have all the rules", () => {
> 4 |   expect(rules).toMatchSnapshot();
    |                 ^
  5 | });
  6 | 
  7 | it("should have a recommended config with recommended rules", () => {

  at Object.it (tests/index.test.js:4:17)
› 1 snapshot failed. PASS tests/lib/rules/no-only.js PASS tests/lib/rules/no-skip.js PASS tests/lib/rules/no-debug.js ------------------ --------- ---------- --------- --------- ------------------- File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 100 100 100 100
master 100 100 100 100
index.js 100 100 100 100
master/lib/rules 100 100 100 100
no-debug.js 100 100 100 100
no-only.js 100 100 100 100
no-skip.js 100 100 100 100
------------------ --------- ---------- --------- --------- -------------------

Snapshot Summary › 1 snapshot failed from 1 test suite. Inspect your code changes or run npm test -- -u to update them.

Test Suites: 1 failed, 3 passed, 4 total Tests: 1 failed, 16 passed, 17 total Snapshots: 1 failed, 1 total Time: 4.596 s Ran all test suites.

benmonro commented 4 years ago

@miherlosev ok updated, please try again.

benmonro commented 4 years ago

@miherlosev I addressed your feedback.

benmonro commented 4 years ago

@miherlosev ? can we merge this now?

benmonro commented 4 years ago

@miherlosev sorry I need these rules and can't wait (we have some tight deadlines). Decided to move this to a new org called testcafe-community