diff --git a/scripts/generate-queries.ts b/scripts/generate-queries.ts index 7f33cb0..ee0797f 100644 --- a/scripts/generate-queries.ts +++ b/scripts/generate-queries.ts @@ -110,8 +110,8 @@ export const write = (filesystem = fs) => { `const path = require('path')\n` + // `const fs = require('fs')\n\n` + `exports.gitFunctionsPath = path.join(__dirname, 'create-git-functions.sql')\n\n` + - `exports.getGitFunctionsSql = () => fs.readFileSync(exports.createGitFunctionsPath, 'utf8')\n\n` + - `exports.getGitFunctionsSqlAsync = () => fs.promises.readFile(exports.createGitFunctionsPath, 'utf8')\n`, + `exports.getGitFunctionsSql = () => fs.readFileSync(exports.gitFunctionsPath, 'utf8')\n\n` + + `exports.getGitFunctionsSqlAsync = () => fs.promises.readFile(exports.gitFunctionsPath, 'utf8')\n`, 'utf8', ) filesystem.writeFileSync( diff --git a/test/exports.test.ts b/test/exports.test.ts new file mode 100644 index 0000000..59c5feb --- /dev/null +++ b/test/exports.test.ts @@ -0,0 +1,5 @@ +test('queries exports', async () => { + expect(require('../queries').gitFunctionsPath).toEqual(expect.any(String)) + expect(require('../queries').getGitFunctionsSql()).toEqual(expect.any(String)) + expect(await require('../queries').getGitFunctionsSqlAsync()).toEqual(expect.any(String)) +})