mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-04-22 04:28:01 +00:00
Add quotes around stringified JSON
This commit is contained in:
@@ -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([]);
|
||||
});
|
||||
|
||||
@@ -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}`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user