mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-06-14 05:01:03 +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 '.';
|
import { retrieveAddrList } from '.';
|
||||||
|
|
||||||
|
const TICKS = '```';
|
||||||
|
|
||||||
// a timeout with a 2s timeout
|
// a timeout with a 2s timeout
|
||||||
async function fetchWithTimeout (url: string, timeout = 2000): Promise<Response> {
|
async function fetchWithTimeout (url: string, timeout = 2000): Promise<Response> {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
@@ -103,7 +105,7 @@ describe('addrcheck', (): void => {
|
|||||||
console.log('Addresses found\n', JSON.stringify(mapFound, null, 2));
|
console.log('Addresses found\n', JSON.stringify(mapFound, null, 2));
|
||||||
console.log('Addresses missing\n', JSON.stringify(mapMiss, 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([]);
|
expect(sites).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ interface EthPhishing {
|
|||||||
blacklist: string[];
|
blacklist: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const TICKS = '```';
|
||||||
|
|
||||||
function assertAndLog (check: boolean, error: string): void {
|
function assertAndLog (check: boolean, error: string): void {
|
||||||
if (!check) {
|
if (!check) {
|
||||||
process.env.CI_LOG && fs.appendFileSync('./.github/crosscheck.md', `
|
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));
|
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