• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

platinumazure / eslint-plugin-qunit / 5244492784

pending completion
5244492784

push

github

web-flow
Upgrade: Bump release-it from 15.10.1 to 15.11.0

Bumps [release-it](https://github.com/release-it/release-it) from 15.10.1 to 15.11.0.
- [Release notes](https://github.com/release-it/release-it/releases)
- [Changelog](https://github.com/release-it/release-it/blob/main/CHANGELOG.md)
- [Commits](https://github.com/release-it/release-it/compare/15.10.1...15.11.0)

---
updated-dependencies:
- dependency-name: release-it
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

653 of 653 branches covered (100.0%)

878 of 878 relevant lines covered (100.0%)

661.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/lib/rules/no-assert-logical-expression.js
1
/**
2
 * @fileoverview forbid binary logical expressions in assert arguments
3
 * @author Kevin Partington
4
 */
5
"use strict";
6

7
//------------------------------------------------------------------------------
8
// Requirements
9
//------------------------------------------------------------------------------
10

11
const utils = require("../utils");
8✔
12

13
//------------------------------------------------------------------------------
14
// Rule Definition
15
//------------------------------------------------------------------------------
16

17
/** @type {import('eslint').Rule.RuleModule} */
18
module.exports = {
8✔
19
    meta: {
20
        type: "suggestion",
21
        docs: {
22
            description: "disallow binary logical expressions in assert arguments",
23
            category: "Best Practices",
24
            recommended: false,
25
            url: "https://github.com/platinumazure/eslint-plugin-qunit/blob/master/docs/rules/no-assert-logical-expression.md"
26
        },
27
        fixable: null,
28
        messages: {
29
            noLogicalOperator: "Do not use '{{operator}}' in assertion arguments."
30
        },
31
        schema: []
32
    },
33

34
    create: function (context) {
35
        const testStack = [];
344✔
36

37
        //----------------------------------------------------------------------
38
        // Helpers
39
        //----------------------------------------------------------------------
40

41
        function checkAndReport(argNodes) {
42
            for (const arg of argNodes) {
336✔
43
                if (arg.type === "LogicalExpression") {
552✔
44
                    context.report({
320✔
45
                        node: arg,
46
                        messageId: "noLogicalOperator",
47
                        data: {
48
                            operator: arg.operator
49
                        }
50
                    });
51
                }
52
            }
53
        }
54

55
        function getAssertVar() {
56
            let result = null;
680✔
57

58
            if (testStack.length > 0) {
680✔
59
                result = testStack[testStack.length - 1].assertContextVar;
672✔
60
            }
61

62
            return result;
680✔
63
        }
64

65
        //----------------------------------------------------------------------
66
        // Public
67
        //----------------------------------------------------------------------
68

69
        return {
344✔
70

71
            "CallExpression": function (node) {
72
                if (utils.isTest(node.callee)) {
680✔
73
                    testStack.push({
336✔
74
                        assertContextVar: utils.getAssertContextNameForTest(node.arguments)
75
                    });
76
                } else if (utils.isAssertion(node.callee, getAssertVar())) {
344✔
77
                    const countNonMessageArgs = Math.max(...utils.getAllowedArities(node.callee, getAssertVar()));
336✔
78
                    checkAndReport(node.arguments.slice(0, countNonMessageArgs));
336✔
79
                }
80
            },
81

82
            "CallExpression:exit": function (node) {
83
                if (utils.isTest(node.callee)) {
680✔
84
                    testStack.pop();
336✔
85
                }
86
            }
87

88
        };
89
    }
90
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc