Skip to content

Commit

Permalink
fix: queries exports
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkal committed Aug 10, 2021
1 parent b03b285 commit 4977042
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/generate-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 5 additions & 0 deletions test/exports.test.ts
Original file line number Diff line number Diff line change
@@ -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))
})

0 comments on commit 4977042

Please sign in to comment.