diff --git a/test/helper.ts b/test/helper.ts new file mode 100644 index 0000000..1062e67 --- /dev/null +++ b/test/helper.ts @@ -0,0 +1,10 @@ +import fs from 'fs'; +import path from 'path'; + +export const readSQL = (dirname: string, fileName: string, isSegment = true) => { + const sqlFiles = fs.readFileSync(path.join(dirname, 'fixtures', fileName), 'utf-8') + if (!isSegment) return [sqlFiles]; + return sqlFiles.split(';') + .filter(Boolean) + .map((i) => i.trim()); +} \ No newline at end of file