Skip to content

Commit

Permalink
Merge pull request #193 from pelias/remove-fs-extra
Browse files Browse the repository at this point in the history
feat(deps): Remove fs-extra
  • Loading branch information
orangejulius authored May 5, 2020
2 parents b2087bc + 4b239fb commit a6cb828
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion output_generators/csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'use strict';

var util = require( 'util' );
var fs = require('fs-extra');
var fs = require('fs');
var terminal = require('./terminal');
var haversine = require( 'haversine' ); // distance measure for angle coords

Expand Down
4 changes: 2 additions & 2 deletions output_generators/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'use strict';

var util = require( 'util' );
var fs = require('fs-extra');
var fs = require('fs');
var terminal = require('./terminal');
var sanitize_filename = require('sanitize-filename');

Expand All @@ -25,7 +25,7 @@ function replace(key, value) {
function saveFailTestResult( testCase ) {
var result = testSuiteHelpers.getMainResult(testCase);
if( result.result === 'fail' && testCase.status === 'pass' ) {
fs.ensureDirSync('./failures');
fs.mkdirSync('./failures', { recursive: true });
var recordFailFile = './failures/' + sanitize_filename(
util.format('%s_%s.json', testCase.id, testCase.in.text));
var recordFail = {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"commander": "^4.0.0",
"deep-diff": "^1.0.0",
"fj-compose": "^1.1.0",
"fs-extra": "^9.0.0",
"handlebars": "^4.0.5",
"haversine": "^1.0.0",
"is-object": "^1.0.1",
Expand Down
7 changes: 4 additions & 3 deletions scripts/bulkAcceptanceTestsUpdate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var fs = require('fs-extra');
var fs = require('fs');
var fileName = process.argv[2];
var _ = require('lodash');
var path = require('path');
Expand Down Expand Up @@ -63,14 +63,15 @@ function changeTestSuite(file) {
if (path.extname(file) !== '.json') {
return;
}
var json = fs.readJSONSync(file);
const file_contents = fs.readFileSync(file);
var json = JSON.parse(file_contents);
json.tests = changeTestCases(json.tests);

if (ENDPOINT_MAP.hasOwnProperty(json.endpoint)) {
json.endpoint = ENDPOINT_MAP[json.endpoint];
}

fs.writeJsonSync(file, json);
fs.writeSync(file, JSON.stringify(json, null, 2));
}

function changeTestCases(tests) {
Expand Down
8 changes: 5 additions & 3 deletions scripts/resolvePlaceholders.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var fs = require('fs-extra');
var fs = require('fs');
var path = require('path');
var request = require('sync-request');
var _ = require('lodash');
Expand Down Expand Up @@ -26,10 +26,12 @@ function changeTestSuite(file) {
if (path.extname(file) !== '.json') {
return;
}
var json = fs.readJSONSync(file);
const file_contents = fs.readFileSync(file);
var json = JSON.parse(file_contents);

json.tests = changeTestCases(json.tests);

fs.writeJsonSync(file, json);
fs.writeSync(file, JSON.stringify(json, null, 2));
}

function changeTestCases(tests) {
Expand Down

0 comments on commit a6cb828

Please sign in to comment.