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

Code before:
        });

        describe("with lintText", () => {
            it("should throw an error when pattern is passed instead of code", () => {
                assert.rejects(async () => {
                    eslint = new ESLint({
                        cwd: path.join(fixtureDir, ".."),
                        overrideConfigFile: true,
                        fix: true,
                        fixTypes: ["layout"]
                    });
                    const inputPath = getFixturePath("fix-types/fix-only-semi.js");

                    await eslint.lintText([inputPath]);
                }, /'code' must be a string\./iu);
            });

            it("should not fix any rules when fixTypes is used without fix", async () => {
                eslint = new ESLint({
                    cwd: path.join(fixtureDir, ".."),
                    overrideConfigFile: true,
                    fix: false,
                    fixTypes: ["layout"]
                });
                const inputPath = getFixturePath("fix-types/fix-only-semi.js");
                const content = await fs.readFileSync(inputPath, "utf8");
                const results = await eslint.lintText(content, { filePath: inputPath });

                assert.strictEqual(results[0].output, void 0);
            });

            it("should not fix non-style rules when fixTypes has only 'layout'", async () => {
                eslint = new ESLint({
                    cwd: path.join(fixtureDir, ".."),
                    overrideConfigFile: true,
                    fix: true,
                    fixTypes: ["layout"]
                });
                const inputPath = getFixturePath("fix-types/fix-only-semi.js");
                const outputPath = getFixturePath("fix-types/fix-only-semi.expected.js");
                const content = await fs.readFileSync(inputPath, "utf8");
                const results = await eslint.lintText(content, { filePath: inputPath });
                const expectedOutput = fs.readFileSync(outputPath, "utf8");

                assert.strictEqual(results[0].output, expectedOutput);
            });

            it("should not fix style or problem rules when fixTypes has only 'suggestion'", async () => {
                eslint = new ESLint({
                    cwd: path.join(fixtureDir, ".."),
                    overrideConfigFile: true,

Review comment (suggestion):
`await` is not required for synchronous calls like `fs.readFileSync`. But it is required for asynchronous calls like `fsp.readFile` (from Node.js [fs Promises API](https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_promises_api)).

So we could use one of `fs.readFileSync` (without `await`) or `await fsp.readFile` here. Whichever you choose, I would just suggest to stay consistent and use the same call in all the other tests, as that makes the code clearer.

Code after:
        });

        describe("with lintText", () => {
            it("should not fix any rules when fixTypes is used without fix", async () => {
                eslint = new ESLint({
                    cwd: path.join(fixtureDir, ".."),
                    overrideConfigFile: true,
                    fix: false,
                    fixTypes: ["layout"]
                });
                const inputPath = getFixturePath("fix-types/fix-only-semi.js");
                const content = fs.readFileSync(inputPath, "utf8");
                const results = await eslint.lintText(content, { filePath: inputPath });

                assert.strictEqual(results[0].output, void 0);
            });

            it("should not fix non-style rules when fixTypes has only 'layout'", async () => {
                eslint = new ESLint({
                    cwd: path.join(fixtureDir, ".."),
                    overrideConfigFile: true,
                    fix: true,
                    fixTypes: ["layout"]
                });
                const inputPath = getFixturePath("fix-types/fix-only-semi.js");
                const outputPath = getFixturePath("fix-types/fix-only-semi.expected.js");
                const content = fs.readFileSync(inputPath, "utf8");
                const results = await eslint.lintText(content, { filePath: inputPath });
                const expectedOutput = fs.readFileSync(outputPath, "utf8");

                assert.strictEqual(results[0].output, expectedOutput);
            });

            it("should not fix style or problem rules when fixTypes has only 'suggestion'", async () => {
                eslint = new ESLint({
                    cwd: path.join(fixtureDir, ".."),
                    overrideConfigFile: true,
                    fix: true,
                    fixTypes: ["suggestion"]
                });
                const inputPath = getFixturePath("fix-types/fix-only-prefer-arrow-callback.js");
                const outputPath = getFixturePath("fix-types/fix-only-prefer-arrow-callback.expected.js");
                const content = fs.readFileSync(inputPath, "utf8");
                const results = await eslint.lintText(content, { filePath: inputPath });
                const expectedOutput = fs.readFileSync(outputPath, "utf8");

                assert.strictEqual(results[0].output, expectedOutput);
            });

            it("should fix both style and problem rules when fixTypes has 'suggestion' and 'layout'", async () => {
                eslint = new ESLint({