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,7 @@
import test from 'node:test';
test('less assertions than planned', (t) => {
t.plan(2);
t.assert.ok(true, 'only one assertion');
// Missing second assertion
});

View File

@ -0,0 +1,7 @@
import test from 'node:test';
test('matching assertions', (t) => {
t.plan(2);
t.assert.ok(true, 'first assertion');
t.assert.ok(true, 'second assertion');
});

View File

@ -0,0 +1,7 @@
import test from 'node:test';
test('more assertions than planned', (t) => {
t.plan(1);
t.assert.ok(true, 'first assertion');
t.assert.ok(true, 'extra assertion'); // This should cause failure
});

View File

@ -0,0 +1,14 @@
import test from 'node:test';
test('deeply nested tests', async (t) => {
t.plan(1);
await t.test('level 1', async (t) => {
t.plan(1);
await t.test('level 2', (t) => {
t.plan(1);
t.assert.ok(true, 'deepest assertion');
});
});
});

View File

@ -0,0 +1,9 @@
import test from 'node:test';
test('failing planning by options', { plan: 1 }, () => {
// Should fail - no assertions
});
test('passing planning by options', { plan: 1 }, (t) => {
t.assert.ok(true);
});

View File

@ -0,0 +1,20 @@
import test from 'node:test';
import { Readable } from 'node:stream';
test('planning with streams', (t, done) => {
function* generate() {
yield 'a';
yield 'b';
yield 'c';
}
const expected = ['a', 'b', 'c'];
t.plan(expected.length);
const stream = Readable.from(generate());
stream.on('data', (chunk) => {
t.assert.strictEqual(chunk, expected.shift());
});
stream.on('end', () => {
done();
});
});

View File

@ -0,0 +1,9 @@
import test from 'node:test';
test('parent test', async (t) => {
t.plan(1);
await t.test('child test', (t) => {
t.plan(1);
t.assert.ok(true, 'child assertion');
});
});

View File

@ -0,0 +1,15 @@
import test from 'node:test';
test('planning with wait should PASS within timeout', async (t) => {
t.plan(1, { wait: 5000 });
setTimeout(() => {
t.assert.ok(true);
}, 250);
});
test('planning with wait should FAIL within timeout', async (t) => {
t.plan(1, { wait: 5000 });
setTimeout(() => {
t.assert.ok(false);
}, 250);
});

View File

@ -0,0 +1,8 @@
import test from 'node:test';
test('planning should FAIL when wait time expires before plan is met', (t) => {
t.plan(2, { wait: 500 });
setTimeout(() => {
t.assert.ok(true);
}, 30_000).unref();
});

View File

@ -0,0 +1,11 @@
import test from 'node:test';
test('should not wait for assertions and fail immediately', async (t) => {
t.plan(1, { wait: false });
// Set up an async operation that won't complete before the test finishes
// Since wait:false, the test should fail immediately without waiting
setTimeout(() => {
t.assert.ok(true);
}, 1000).unref();
});

View File

@ -0,0 +1,17 @@
import test from 'node:test';
test('should pass when assertions are eventually met', async (t) => {
t.plan(1, { wait: true });
setTimeout(() => {
t.assert.ok(true);
}, 250);
});
test('should fail when assertions fail', async (t) => {
t.plan(1, { wait: true });
setTimeout(() => {
t.assert.ok(false);
}, 250).unref();
});