UNPKG

@tapjs/node-serialize

Version:

Stream TAP test data as a serialized node:test stream

18 lines 517 B
import { format } from 'util'; import { locFromAt } from './loc-from-at.js'; export const commentMethod = (stream, diagsMap) => { return function comment(...args) { const message = format(...args); const diags = diagsMap.get(this); const m = { ...locFromAt(comment), nesting: this.nestingLevel, message, }; if (diags) diags.push(m); else stream.diagnostic(m); }; }; //# sourceMappingURL=comment.js.map