From fda26b09a222e51e21f81931411e7f0f70d1baf6 Mon Sep 17 00:00:00 2001 From: Julien Bisconti Date: Sat, 23 Oct 2021 23:19:10 +0200 Subject: [PATCH] load json readfileSync --- tests/common.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/common.mjs b/tests/common.mjs index 350bead..add834d 100644 --- a/tests/common.mjs +++ b/tests/common.mjs @@ -1,5 +1,5 @@ import fetch from 'node-fetch'; -const exclude = require('./exclude_in_test.json'); +import {readFileSync} from 'fs'; const LINKS_OPTIONS = { redirect: 'error', @@ -78,6 +78,8 @@ async function batch_fetch({ arr, get, post_filter_func, BATCH_SIZE = 8 }) { return result; } +const data = readFileSync('./tests/exclude_in_test.json') +const exclude = JSON.parse(data) const exclude_length = exclude.length; const exclude_from_list = (link) => { let is_excluded = false; @@ -90,7 +92,7 @@ const exclude_from_list = (link) => { return is_excluded; }; -export { +export default { LOG, handleFailure, extract_all_links,