How to use node-color-log - 9 common examples

To help you get started, we’ve selected a few node-color-log examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github weather-bot / WxKitty / test / lib / keywords.spec.js View on Github external
it('Test isTaiwanArea', done => {
        let msg = "台北士林的天氣狀況";
        assert.equal(
            isTaiwanArea(msg).name.includes("臺北市士林區"),
            true,
            logger.debug(`${msg} & ${isTaiwanArea(msg).name}`)
        );
        msg = "台中明天天氣";
        assert.equal(
            isTaiwanArea(msg).name.includes("臺中市北屯區北屯里"),
            true,
            logger.debug(`${msg} & ${isTaiwanArea(msg).name}`)
        );
        msg = "我想知道桃園復興霞雲天氣";
        assert.equal(
            isTaiwanArea(msg).name.includes("桃園市復興區霞雲里"),
            true,
            logger.debug(`${msg} & ${isTaiwanArea(msg).name}`)
        );
        msg = "我想知道中壢天氣";
        assert.equal(
            isTaiwanArea(msg).name.includes("桃園市中壢區"),
github weather-bot / WxKitty / test / lib / areaWeather.spec.js View on Github external
(async () => {
            const msg = await getAreaWeather({
                realAreaName: "士林區",
                lon: "121.5357813",
                lat: "25.10390683"
            });
            logger.debug(msg);
            assert.equal(msg.includes("資料來源:中央氣象局"), true);
            done();
        })();
    }).timeout(5000);
github weather-bot / WxKitty / test / lib / getEarthquake.spec.js View on Github external
(async () => {
            const url = await getEarthquake();
            logger.debug(url);
            assert.equal(url.includes("https://"), true);
            assert.notEqual(url, null);
            done();
        })();
    }).timeout(10000);
github weather-bot / WxKitty / test / lib / getForecast.spec.js View on Github external
(async () => {
            let msg = await getForecast("臺北市後天的天氣");
            logger.debug(msg);
            assert.equal(msg.includes("臺北市"), true);
            assert.equal(msg.includes("最低溫度"), true);

            msg = await getForecast("苗栗五天後的天氣");
            logger.debug(msg);
            assert.equal(msg.includes("苗栗"), true);
            assert.equal(msg.includes("最低溫度"), true);

            msg = await getForecast("高雄市6天後的天氣");
            logger.debug(msg);
            assert.equal(msg.includes("高雄市"), true);
            assert.equal(msg.includes("最低溫度"), true);
            done();
        })();
    }).timeout(30000);
github weather-bot / WxKitty / test / lib / createAirImage.spec.js View on Github external
(async () => {
            const url = await createAirImage();
            logger.debug(url);
            assert.ok(url);
            done();
        })();
    }).timeout(10000);
github weather-bot / WxKitty / test / lib / getForecast.spec.js View on Github external
(async () => {
            let msg = await getForecast("士林區明天的天氣");
            logger.debug(msg);
            assert.equal(msg.includes("臺北市"), true);
            assert.equal(msg.includes("降雨機率"), true);

            msg = await getForecast("台中明天14:00天氣");
            logger.debug(msg);
            assert.equal(msg.includes("臺中市"), true);
            assert.equal(msg.includes("降雨機率"), true);

            msg = await getForecast("宜蘭明天預報");
            logger.debug(msg);
            assert.equal(msg.includes("宜蘭"), true);
            assert.equal(msg.includes("降雨機率"), true);

            msg = await getForecast("紐約明天早上預報");
            logger.debug(msg);
            assert.equal(msg.includes("紐約"), true);
github weather-bot / WxKitty / test / lib / firebase.spec.js View on Github external
(async () => {
            const url = `http://example.com/${Math.floor(Math.random()*100)}`;

            logger.info("test dbWrite");
            const input = {
                url: url
            };
            const res = await dbWrite('tests/url', input);
            assert.equal(res.url, url);

            logger.info("test dbRead");
            const data = await dbRead('tests/url');
            assert.equal(data.url, url);

            logger.info("test dbRead null");
            const dataNull = await dbRead('testNull');
            assert.equal(dataNull, null);

            done();
        })();
    }).timeout(5000);
github weather-bot / WxKitty / test / lib / firebase.spec.js View on Github external
(async () => {
            const url = `http://example.com/${Math.floor(Math.random()*100)}`;

            logger.info("test dbWrite");
            const input = {
                url: url
            };
            const res = await dbWrite('tests/url', input);
            assert.equal(res.url, url);

            logger.info("test dbRead");
            const data = await dbRead('tests/url');
            assert.equal(data.url, url);

            logger.info("test dbRead null");
            const dataNull = await dbRead('testNull');
            assert.equal(dataNull, null);

            done();
        })();
    }).timeout(5000);
github weather-bot / WxKitty / test / lib / firebase.spec.js View on Github external
(async () => {
            const url = `http://example.com/${Math.floor(Math.random()*100)}`;

            logger.info("test dbWrite");
            const input = {
                url: url
            };
            const res = await dbWrite('tests/url', input);
            assert.equal(res.url, url);

            logger.info("test dbRead");
            const data = await dbRead('tests/url');
            assert.equal(data.url, url);

            logger.info("test dbRead null");
            const dataNull = await dbRead('testNull');
            assert.equal(dataNull, null);

            done();
        })();

node-color-log

The more powerful JavaScript logger for NodeJS and browsers.

MIT
Latest version published 7 months ago

Package Health Score

73 / 100
Full package analysis

Popular node-color-log functions