Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,15 @@
import { Transform } from 'node:stream';
export default class CoverageReporter extends Transform {
constructor(options) {
super({ ...options, writableObjectMode: true });
}
_transform(event, _encoding, callback) {
if (event.type === 'test:coverage') {
callback(null, JSON.stringify(event.data, null, 2));
} else {
callback(null);
}
}
}

View File

@ -0,0 +1,17 @@
const { Transform } = require('node:stream');
const customReporter = new Transform({
writableObjectMode: true,
transform(event, encoding, callback) {
this.counters ??= {};
this.counters[event.type] = (this.counters[event.type] ?? 0) + 1;
callback();
},
flush(callback) {
this.push('custom.cjs ')
this.push(JSON.stringify(this.counters));
callback();
}
});
module.exports = customReporter;

View File

@ -0,0 +1,14 @@
const assert = require('assert');
const path = require('path');
module.exports = async function * customReporter(source) {
const counters = {};
for await (const event of source) {
if (event.data.file) {
assert.strictEqual(event.data.file, path.resolve(__dirname, '../reporters.js'));
}
counters[event.type] = (counters[event.type] ?? 0) + 1;
}
yield "custom.js ";
yield JSON.stringify(counters);
};

View File

@ -0,0 +1,8 @@
export default async function * customReporter(source) {
const counters = {};
for await (const event of source) {
counters[event.type] = (counters[event.type] ?? 0) + 1;
}
yield "custom.mjs ";
yield JSON.stringify(counters);
}

View File

@ -0,0 +1,8 @@
'use strict';
module.exports = async function * customReporter() {
yield 'Going to throw an error\n';
setImmediate(() => {
throw new Error('Reporting error');
});
};

View File

@ -0,0 +1,6 @@
'use strict';
module.exports = async function * customReporter() {
yield 'Going to throw an error\n';
throw new Error('Reporting error');
};