Repository: eslint/eslint
File: tests/lib/eslint/eslint.js (JavaScript)

Code before:
					.stub(process, "emitWarning")
					.withArgs(
						sinon.match.any,
						sinon.match(/^ESLintInactiveFlag_/u),
					)
					.returns();
			});

			afterEach(() => {
				delete process.env.ESLINT_FLAGS;
			});

			it("should return true if the flag is present and active", () => {
				eslint = new ESLint({
					cwd: getFixturePath(),
					flags: ["test_only"],
				});

				assert.strictEqual(eslint.hasFlag("test_only"), true);
			});

			it("should return true if the flag is present and active with ESLINT_FLAGS", () => {
				process.env.ESLINT_FLAGS = "test_only";
				eslint = new ESLint({
					cwd: getFixturePath(),
					flags: ["test_only"],
				});
				assert.strictEqual(eslint.hasFlag("test_only"), true);
			});

			it("should return true for multiple flags in ESLINT_FLAGS if the flag is present and active and one is duplicated in the API", () => {
				process.env.ESLINT_FLAGS = "test_only,test_only_2";

				eslint = new ESLint({
					cwd: getFixturePath(),
					flags: ["test_only"], // intentional duplication
				});

				assert.strictEqual(eslint.hasFlag("test_only"), true);
				assert.strictEqual(eslint.hasFlag("test_only_2"), true);
			});

			it("should return true for the replacement flag if an inactive flag that has been replaced is used", () => {
				eslint = new ESLint({
					cwd: getFixturePath(),
					flags: ["test_only_replaced"],
				});

				assert.strictEqual(eslint.hasFlag("test_only"), true);
				assert.strictEqual(
					processStub.callCount,

Review comment (suggestion):
```suggestion
```

I believe this particular test would be more representative if the same flag isn't passed through options.

Code after:
					.stub(process, "emitWarning")
					.withArgs(
						sinon.match.any,
						sinon.match(/^ESLintInactiveFlag_/u),
					)
					.returns();
			});

			afterEach(() => {
				delete process.env.ESLINT_FLAGS;
			});

			it("should return true if the flag is present and active", () => {
				eslint = new ESLint({
					cwd: getFixturePath(),
					flags: ["test_only"],
				});

				assert.strictEqual(eslint.hasFlag("test_only"), true);
			});

			it("should return true if the flag is present and active with ESLINT_FLAGS", () => {
				process.env.ESLINT_FLAGS = "test_only";
				eslint = new ESLint({
					cwd: getFixturePath(),
				});
				assert.strictEqual(eslint.hasFlag("test_only"), true);
			});

			it("should merge flags passed through API with flags passed through ESLINT_FLAGS", () => {
				process.env.ESLINT_FLAGS = "test_only";
				eslint = new ESLint({
					cwd: getFixturePath(),
					flags: ["test_only_2"],
				});
				assert.strictEqual(eslint.hasFlag("test_only"), true);
				assert.strictEqual(eslint.hasFlag("test_only_2"), true);
			});

			it("should return true for multiple flags in ESLINT_FLAGS if the flag is present and active and one is duplicated in the API", () => {
				process.env.ESLINT_FLAGS = "test_only,test_only_2";

				eslint = new ESLint({
					cwd: getFixturePath(),
					flags: ["test_only"], // intentional duplication
				});

				assert.strictEqual(eslint.hasFlag("test_only"), true);
				assert.strictEqual(eslint.hasFlag("test_only_2"), true);
			});