/* eslint-env mocha, browser */ /* global proclaim */ describe('console', function () { it('clear()', function () { proclaim.doesNotThrow(function () { console.clear(); }); }); });
const typeAnswer = (answer) => { // 템플릿 종류 설정 if (answer !== 'html' && answer !== 'express-router') { console.clear(); console.log('html 또는 express-router만 지원합니다.'); return rl.question('어떤 템플릿이 필요하십니까? ', typeAnswer); } type = answer; return rl.question('파일명을 설정하세요. ', nameAnswer); }
componentDidMount() { // Clear console after hot reload, do not clear on the first load // to keep any warnings if (this.context.codeRevision > 0) { // eslint-disable-next-line no-console console.clear(); } this.executeCode(); }
const answerCallback = (answer) => { if (answer === 'y') { console.log('감사합니다!'); rl.close(); } else if (answer === 'n') { console.log('죄송합니다!'); rl.close(); } else { console.clear(); console.log('y 또는 n만 입력하세요.'); rl.question('예제가 재미있습니까? (y/n) ', answerCallback); } }
require('./app')().then(app => { const { dir } = app.__hotControllerOptions || {}; const friendlyPath = path.relative(process.cwd(), dir); app.listen(port, function() { console.clear(); logger( `controlled server started at ${chalk.red(`http://localhost:${port}`)}` ); }); });
it('should clear console on second mount', () => { console.clear = jest.fn(); mount(<Preview code={code} evalInContext={evalInContext} />, { context: { ...options.context, codeRevision: 1 }, }); expect(console.clear).toHaveBeenCalledTimes(1); });
const program = () => { if (!type || !name) { rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); console.clear(); rl.question('어떤 템플릿이 필요하십니까? ', typeAnswer); } else { makeTemplate(); } }
function routeChange(store, history) { (process.env.NODE_ENV === 'production') ? console.clear() : (() => { console.group('router') console.warn('store', store) console.warn('state', store.getState()) console.warn('history', history) console.warn('pathname', history.location.pathname) console.groupEnd() })() listener(store, history) history.listen(() => listener(store, history)) }
scanApps(path.join(osRoot, "apps")).then(() => { console.clear(); console.log("SuperFetch complete. You may disable it in Settings"); });
const nameAnswer = (answer) => { // 파일명 설정 if (!answer || !answer.trim()) { console.clear(); console.log('name을 반드시 입력하셔야 합니다.'); return rl.question('파일명을 설정하세요. ', nameAnswer); } name = answer; return rl.question('저장할 경로를 설정하세요.(설정하지 않으면 현재경로) ', dirAnswer); }
it('should not clear console on initial mount', () => { console.clear = jest.fn(); mount(<Preview code={code} evalInContext={evalInContext} />, options); expect(console.clear).toHaveBeenCalledTimes(0); });
const clear = () => console.clear()