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,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;QAChD,CAAC;QAhSD;YADC,YAAY,EAAE;8CAad;QAGD;YADC,YAAY,EAAE;gDA4Bd;QAGD;YADC,YAAY,EAAE;2CAQd;QAGD;YADC,YAAY,EAAE;6CAQd;QAGD;YADC,YAAY,EAAE;yCAKd;QAGD;YADC,YAAY,EAAE;4CA4Dd;QAGD;YADC,YAAY,EAAE;iDAcd;QAGD;YADC,YAAY,EAAE;8CAmEd;QAGD;YADC,YAAY,EAAE;gDAed;QAGD;YADC,YAAY,EAAE;6CA6Bd;QAGD;YADC,YAAY,EAAE;4DAYd;QAGD;YADC,YAAY,EAAE;iDAGd;QAGD;YADC,YAAY,EAAE;kDAGd;QACH,aAAC;KAAA,AA1UD,CAAoC,sBAAY,GA0U/C;sBA1UoB,MAAM","sourcesContent":["import charm from 'charm';\nimport { createCoverageMap, CoverageMap } from 'istanbul-lib-coverage';\nimport { Writable } from 'stream';\n\nimport Test from '../Test';\nimport Suite from '../Suite';\nimport { createEventHandler } from './Reporter';\nimport TextCoverage, { TextCoverageProperties } from './TextCoverage';\nimport Server from '../Server';\nimport { CoverageMessage, DeprecationMessage } from '../executors/Executor';\nimport Node, { NodeEvents, TunnelMessage } from '../executors/Node';\nimport { prefix } from '../common/util';\n\nexport type Charm = charm.CharmInstance;\n\nconst eventHandler = createEventHandler<NodeEvents>();\n\nexport default class Runner extends TextCoverage implements RunnerProperties {\n sessions: {\n [sessionId: string]: {\n coverage?: CoverageMap;\n suite?: Suite;\n [key: string]: any;\n };\n };\n\n hasRunErrors: boolean;\n hasSuiteErrors: boolean;\n hidePassed: boolean;\n hideSkipped: boolean;\n hideTunnelDownloadProgress: boolean;\n serveOnly: boolean;\n\n private _deprecationMessages: { [message: string]: boolean };\n\n protected charm: Charm;\n\n constructor(executor: Node, options: Partial<RunnerProperties> = {}) {\n super(executor, options);\n\n this.hidePassed = options.hidePassed || false;\n this.hideSkipped = options.hideSkipped || false;\n this.hideTunnelDownloadProgress =\n options.hideTunnelDownloadProgress || false;\n\n this.sessions = {};\n this.hasRunErrors = false;\n this.hasSuiteErrors = false;\n this.serveOnly = executor.config.serveOnly;\n\n this.charm = charm();\n this.charm.pipe(<Writable>this.output);\n this.charm.display('reset');\n\n this._deprecationMessages = {};\n }\n\n @eventHandler()\n coverage(message: CoverageMessage) {\n const sessionId = message.sessionId || '';\n\n // If coverage is emitted for functional suites but unit test suites\n // weren't run, there won't be an existing session for session ID ''\n // (the one used for unit tests and local functional tests)\n if (!this.sessions[sessionId]) {\n this.sessions[sessionId] = {};\n }\n const session = this.sessions[sessionId];\n session.coverage = session.coverage || createCoverageMap();\n session.coverage.merge(message.coverage);\n }\n\n @eventHandler()\n deprecated(message: DeprecationMessage) {\n // Keep track of deprecation messages we've seen before\n const key = `${message.original}|${message.replacement}|${message.message}`;\n if (this._deprecationMessages[key]) {\n return;\n }\n this._deprecationMessages[key] = true;\n\n this.charm\n .foreground('yellow')\n .write('⚠︎ ' + message.original + ' is deprecated. ');\n\n if (message.replacement) {\n this.charm.write('Use ' + message.replacement + ' instead.');\n } else {\n this.charm.write(\n 'Please open a ticket at https://github.com/theintern/intern/issues if you still ' +\n 'require access to this function.'\n );\n }\n\n if (message.message) {\n this.charm.write(' ' + message.message);\n }\n\n this.charm.write('\\n');\n this.charm.display('reset');\n }\n\n @eventHandler()\n error(error: Error) {\n this.charm.foreground('red');\n this.charm.write('(ノಠ益ಠ)ノ彡┻━┻\\n');\n this.charm.write(this.formatError(error));\n this.charm.display('reset');\n this.charm.write('\\n\\n');\n this.hasRunErrors = true;\n }\n\n @eventHandler()\n warning(warning: string | Error) {\n this.charm.foreground('yellow');\n const message =\n typeof warning === 'string' ? warning : this.formatError(warning);\n this.charm.write(`WARNING: ${message.replace(/^Error:\\s+/, '')}`);\n this.charm.display('reset');\n this.charm.write('\\n\\n');\n }\n\n @eventHandler()\n log(message: string) {\n message.split('\\n').forEach((line) => {\n this.console.log(`DEBUG: ${line}`);\n });\n }\n\n @eventHandler()\n runEnd() {\n const map = this.executor.coverageMap;\n let numTests = 0;\n let numPassedTests = 0;\n let numFailedTests = 0;\n let numSkippedTests = 0;\n\n const sessionIds = Object.keys(this.sessions);\n const numEnvironments = sessionIds.length;\n\n // A session may contain only coverage data, so ensure that only those\n // with suites are considered\n sessionIds\n .filter((sessionId) => this.sessions[sessionId].suite)\n .forEach((sessionId) => {\n const suite = this.sessions[sessionId].suite!;\n numTests += suite.numTests;\n numPassedTests += suite.numPassedTests;\n numFailedTests += suite.numFailedTests;\n numSkippedTests += suite.numSkippedTests;\n });\n\n const charm = this.charm;\n\n if (map.files().length > 0) {\n charm.write('\\n');\n charm.display('bright');\n charm.write('Total coverage\\n');\n charm.display('reset');\n this.createCoverageReport(this.reportType, map);\n }\n\n let message = `TOTAL: tested ${numEnvironments} platforms, ${numPassedTests} passed, ${numFailedTests} failed`;\n\n if (numSkippedTests) {\n message += `, ${numSkippedTests} skipped`;\n }\n\n const numUnrunTests =\n numTests - (numPassedTests + numFailedTests + numSkippedTests);\n if (numUnrunTests) {\n message += `, ${numUnrunTests} not run`;\n }\n\n if (this.hasRunErrors) {\n message += '; fatal error occurred';\n } else if (this.hasSuiteErrors) {\n message += '; suite error occurred';\n }\n\n charm.display('bright');\n charm.foreground(\n numFailedTests > 0 || this.hasRunErrors || this.hasSuiteErrors\n ? 'red'\n : 'green'\n );\n charm.write(message);\n charm.display('reset');\n charm.write('\\n');\n }\n\n @eventHandler()\n serverStart(server: Server) {\n if (this.executor.config.serveOnly) {\n this.charm.write(\n `To use the browser client, browse to\\n\\n ${this.executor.config.serverUrl}__intern/\\n\\n`\n );\n this.charm.write('Press CTRL-C to stop serving\\n\\n');\n } else {\n let message = `Listening on localhost:${server.port}`;\n if (server.socketPort) {\n message += ` (ws ${server.socketPort})`;\n }\n this.charm.write(`${message}\\n`);\n }\n }\n\n @eventHandler()\n suiteEnd(suite: Suite) {\n const session = this.sessions[suite.sessionId || ''];\n if (!session) {\n if (!this.serveOnly) {\n const charm = this.charm;\n charm.display('bright');\n charm.foreground('yellow');\n charm.write(\n 'BUG: suiteEnd was received for invalid session ' + suite.sessionId\n );\n charm.display('reset');\n charm.write('\\n');\n }\n\n return;\n }\n\n if (suite.error) {\n const error = suite.error;\n const charm = this.charm;\n\n charm.foreground('red');\n charm.write(\n `Suite ${suite.id} ERROR${\n error.lifecycleMethod ? ` in ${error.lifecycleMethod}` : ''\n }\\n`\n );\n charm.write(this.formatError(error));\n charm.display('reset');\n charm.write('\\n');\n\n this.hasSuiteErrors = session.hasSuiteErrors = true;\n } else if (!suite.hasParent && this.executor.suites.length > 1) {\n if (session.coverage) {\n this.charm.write('\\n');\n this.createCoverageReport(this.reportType, session.coverage);\n } else {\n const charm = this.charm;\n charm.write('No unit test coverage for ' + suite.name);\n charm.display('reset');\n charm.write('\\n');\n }\n\n const name = suite.name;\n const hasError = suite.error || session.hasSuiteErrors;\n const numTests = suite.numTests;\n const numFailedTests = suite.numFailedTests;\n const numSkippedTests = suite.numSkippedTests;\n const numPassedTests = numTests - numFailedTests - numSkippedTests;\n\n let summary = `${name}: ${numPassedTests} passed, ${numFailedTests} failed`;\n if (numSkippedTests) {\n summary += `, ${numSkippedTests} skipped`;\n }\n\n if (hasError) {\n summary += '; suite error occurred';\n }\n\n const charm = this.charm;\n charm.display('bright');\n charm.foreground(numFailedTests || hasError > 0 ? 'red' : 'green');\n charm.write(summary);\n charm.display('reset');\n charm.write('\\n');\n }\n }\n\n @eventHandler()\n suiteStart(suite: Suite) {\n if (!suite.hasParent) {\n this.sessions[suite.sessionId || ''] = { suite: suite };\n if (suite.sessionId) {\n this.charm.write('\\n');\n this.charm.write(\n '‣ Created remote session ' +\n suite.name +\n ' (' +\n suite.sessionId +\n ')\\n'\n );\n }\n }\n }\n\n @eventHandler()\n testEnd(test: Test) {\n const charm = this.charm;\n if (test.error) {\n charm.foreground('red');\n charm.write('× ' + test.id);\n charm.write(' (' + test.timeElapsed! / 1000 + 's)');\n charm.write('\\n');\n charm.write(prefix(this.formatError(test.error), ' '));\n charm.display('reset');\n charm.write('\\n\\n');\n } else if (test.skipped) {\n if (!this.hideSkipped) {\n charm.write('~ ' + test.id);\n charm.display('reset');\n charm.write(' (' + (test.skipped || 'skipped') + ')');\n charm.display('reset');\n charm.write('\\n');\n }\n } else {\n if (!this.hidePassed) {\n charm.foreground('green');\n charm.write('✓ ' + test.id);\n charm.display('reset');\n charm.write(' (' + test.timeElapsed! / 1000 + 's)');\n charm.display('reset');\n charm.write('\\n');\n }\n }\n }\n\n @eventHandler()\n tunnelDownloadProgress(message: TunnelMessage) {\n if (this.hideTunnelDownloadProgress) {\n return;\n }\n\n const progress = message.progress!;\n this.charm.write(\n 'Tunnel download: ' +\n ((progress.received / progress.total) * 100).toFixed(3) +\n '%\\r'\n );\n }\n\n @eventHandler()\n tunnelStart(_: TunnelMessage) {\n this.charm.write('Tunnel started\\n');\n }\n\n @eventHandler()\n tunnelStatus(message: TunnelMessage) {\n this.charm.write(message.status + '\\x1b[K\\r');\n }\n}\n\nexport interface RunnerProperties extends TextCoverageProperties {\n hidePassed: boolean;\n hideSkipped: boolean;\n hideTunnelDownloadProgress: boolean;\n}\n"]}
\No newline at end of file