Skip to content

Commit c81d6fb

Browse files
committed
Fix issue with testData.json
This file was incorrectly being written to the root directory.
1 parent 3c59068 commit c81d6fb

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

test/makeTestData.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const fs = require('fs')
2+
const path = require('path')
23

34
const rawTestData = {
45
inputOne: [
@@ -2900,10 +2901,13 @@ const rawTestData = {
29002901
}
29012902
}
29022903

2903-
// cd into test directory
2904-
// $ node makeTestData.js
2904+
// Can be run from anywhere: $ node test/makeTestData.js
29052905
console.log('Writing file')
2906-
fs.writeFile('./testData.json', JSON.stringify(rawTestData, null, 2), err => {
2907-
if (err) throw err
2908-
console.log('File written successfully.')
2909-
})
2906+
fs.writeFile(
2907+
path.join(__dirname, 'testData.json'),
2908+
JSON.stringify(rawTestData, null, 2),
2909+
err => {
2910+
if (err) throw err
2911+
console.log('File written successfully.')
2912+
}
2913+
)

test/testData.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@
12691269
"hour": [],
12701270
"numAllTxs": 165
12711271
},
1272-
"appId": "edge",
1272+
"app": "edge",
12731273
"pluginId": "coinswitch",
12741274
"start": 1594023608,
12751275
"end": 1596055300
@@ -1548,7 +1548,7 @@
15481548
],
15491549
"numAllTxs": 5
15501550
},
1551-
"appId": "app-dummy",
1551+
"app": "app-dummy",
15521552
"pluginId": "partner-dummy",
15531553
"start": 1300000000,
15541554
"end": 1300070000
@@ -2655,7 +2655,7 @@
26552655
],
26562656
"numAllTxs": 5
26572657
},
2658-
"appId": "app-dummy",
2658+
"app": "app-dummy",
26592659
"pluginId": "partner-dummy",
26602660
"start": 1708992000,
26612661
"end": 1709424000
@@ -2814,9 +2814,9 @@
28142814
"hour": [],
28152815
"numAllTxs": 2
28162816
},
2817-
"appId": "app-dummy",
2817+
"app": "app-dummy",
28182818
"pluginId": "partner-dummy",
28192819
"start": 1672444800,
28202820
"end": 1706918400
28212821
}
2822-
}
2822+
}

0 commit comments

Comments
 (0)