Add quotes around stringified JSON

This commit is contained in:
Jaco Greeff
2021-02-13 11:00:45 +01:00
parent 0b10d4ad7a
commit a055b37add
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -7,6 +7,8 @@ import { fetch } from '@polkadot/x-fetch';
import { retrieveAddrList } from '.';
const TICKS = '```';
// a timeout with a 2s timeout
async function fetchWithTimeout (url: string, timeout = 2000): Promise<Response> {
const controller = new AbortController();
@@ -103,7 +105,7 @@ describe('addrcheck', (): void => {
console.log('Addresses found\n', JSON.stringify(mapFound, null, 2));
console.log('Addresses missing\n', JSON.stringify(mapMiss, null, 2));
sites.length && process.env.CI_LOG && fs.appendFileSync('./.github/addrcheck.md', `\n\n${sites.length} urls with missing entries found at ${new Date().toUTCString()}:\n\n${JSON.stringify(mapMiss, null, 2)}\n`);
sites.length && process.env.CI_LOG && fs.appendFileSync('./.github/addrcheck.md', `\n\n${sites.length} urls with missing entries found at ${new Date().toUTCString()}:\n\n${TICKS}\n${JSON.stringify(mapMiss, null, 2)}\n${TICKS}\n`);
expect(sites).toEqual([]);
});
+3 -1
View File
@@ -22,6 +22,8 @@ interface EthPhishing {
blacklist: string[];
}
const TICKS = '```';
function assertAndLog (check: boolean, error: string): void {
if (!check) {
process.env.CI_LOG && fs.appendFileSync('./.github/crosscheck.md', `
@@ -66,6 +68,6 @@ describe('crosscheck', (): void => {
console.log('eth-phishing-detect', JSON.stringify(filtered, null, 2));
assertAndLog(missing.length === 0, `Missing entries found from eth-phishing-detect: ${JSON.stringify(missing, null, 2)}`);
assertAndLog(missing.length === 0, `Missing entries found from eth-phishing-detect:\n\n${TICKS}\n${JSON.stringify(missing, null, 2)}\n${TICKS}`);
});
});