Skip to content

Limitation: no-assert-ok does not working for nested function #199

Open
@Mifrill

Description

rule enabled in .eslintrc.js:

  extends: [
    'plugin:qunit/recommended',
  ],
  // ...
  rules: {
    'qunit/no-assert-ok': 2,
  },

but the Rule ignores if assert.ok is used in shared function:

  test('test 1', async function (assert) {
    await sharedAssert(assert);
  });

  test('test 2', async function (assert) {
    await sharedAssert(assert);
  });

  async function sharedAssert(assert) {
    await visit('/');
    assert.ok(true);
  }

For example:
https://github.com/Mifrill/demo-eslint-plugin-qunit-no-assert-ok-ignore-nested-function/blob/4053e43237290754a88939e49e27732feeba24d3/tests/acceptance/index-test.js#L1-L22

Lint passed:
https://github.com/Mifrill/demo-eslint-plugin-qunit-no-assert-ok-ignore-nested-function/runs/3266269169

Rule:
https://github.com/platinumazure/eslint-plugin-qunit/blob/master/docs/rules/no-assert-ok.md

Repo with bug reproduce:
https://github.com/Mifrill/demo-eslint-plugin-qunit-no-assert-ok-ignore-nested-function

Expected lint:js failed:
Mifrill/demo-eslint-plugin-qunit-no-assert-ok-ignore-nested-function#1

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions