--- a/tests/src/migrations/942057-appPromotion/collect-data.sh +++ /dev/null @@ -1 +0,0 @@ -chainql --tla-str=chainUrl=ws://127.0.0.1:9944 stakersParser.jsonnet > output.json \ No newline at end of file --- a/tests/src/migrations/942057-appPromotion/collectData.ts +++ b/tests/src/migrations/942057-appPromotion/collectData.ts @@ -1,3 +1,15 @@ -import {spawnSync} from 'child_process'; +import {execSync} from 'child_process'; +import path from 'path'; +import {dirname} from 'path'; +import {fileURLToPath} from 'url'; + +export const collectData = () => { + const dirName = dirname(fileURLToPath(import.meta.url)); + + const pathToScript = path.resolve(dirName, './stakersParser.jsonnet'); + const outputPath = path.resolve(dirName, './output.json'); + // execSync(`chainql --tla-str=chainUrl=wss://ws-quartz.unique.network:443 ${pathToScript} > ${outputPath}`); + execSync(`chainql --tla-str=chainUrl=ws://127.0.0.1:9944 ${pathToScript} > ${outputPath}`); +}; -export const collectData = () => spawnSync('sh', ['./collect-data.sh']); +collectData();