diff --git a/.changeset/eight-bats-beg.md b/.changeset/eight-bats-beg.md new file mode 100644 index 00000000..a35ea24a --- /dev/null +++ b/.changeset/eight-bats-beg.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/eslint-plugin": patch +--- + +Ensure sync-tag rule has access to 'execSync' diff --git a/packages/eslint-plugin-khan/lib/util.js b/packages/eslint-plugin-khan/lib/util.js index 97462d59..55caefb5 100644 --- a/packages/eslint-plugin-khan/lib/util.js +++ b/packages/eslint-plugin-khan/lib/util.js @@ -1,6 +1,7 @@ -const {execFile} = require("child_process"); +const {execFile, execSync} = require("child_process"); // This is done so that we can override execSync in the tests module.exports = { execFile, + execSync, }; diff --git a/packages/eslint-plugin-khan/test/sync-tag_test.js b/packages/eslint-plugin-khan/test/sync-tag_test.js index 6125064c..a5160e00 100644 --- a/packages/eslint-plugin-khan/test/sync-tag_test.js +++ b/packages/eslint-plugin-khan/test/sync-tag_test.js @@ -1,3 +1,5 @@ +const assert = require("assert"); + const {rules} = require("../lib/index.js"); const util = require("../lib/util.js"); const RuleTester = require("eslint").RuleTester; @@ -9,6 +11,7 @@ const parserOptions = { const ruleTester = new RuleTester(parserOptions); const rule = rules["sync-tag"]; +assert(util.execSync); util.execSync = (command) => { console.log("execSync mock --------"); if (command.includes("filea")) {