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,21 @@
'use strict';
const { test } = require('node:test');
test('snapshot file path is created', (t) => {
t.assert.fileSnapshot({ baz: 9 }, './foo/bar/baz/1.json');
});
test('test with plan', (t) => {
t.plan(2);
t.assert.fileSnapshot({ foo: 1, bar: 2 }, '2.json');
t.assert.fileSnapshot(5, '3.txt');
});
test('custom serializers are supported', (t) => {
t.assert.fileSnapshot({ foo: 1 }, '4.txt', {
serializers: [
(value) => { return value + '424242'; },
(value) => { return JSON.stringify(value); },
]
});
});

View File

@ -0,0 +1,8 @@
'use strict';
const { suite, test } = require('node:test');
suite('imported suite', () => {
test('imported test', (t) => {
t.assert.snapshot({ foo: 1, bar: 2 });
});
});

View File

@ -0,0 +1 @@
exports = null;

View File

@ -0,0 +1,6 @@
exports[`foo 1`] = `
{
"bar": 1,
"baz": 2
}
`;

View File

@ -0,0 +1,19 @@
'use strict';
const { snapshot, test } = require('node:test');
const { basename, join } = require('node:path');
snapshot.setResolveSnapshotPath((testFile) => {
return join(process.cwd(), `${basename(testFile)}.snapshot`);
});
test('\r', (t) => {
t.assert.snapshot({ key: 'value' });
});
test(String.fromCharCode(55296), (t) => {
t.assert.snapshot({ key: 'value' });
});
test(String.fromCharCode(57343), (t) => {
t.assert.snapshot({ key: 'value' });
});

View File

@ -0,0 +1,11 @@
'use strict';
const { snapshot, test } = require('node:test');
const { basename, join } = require('node:path');
snapshot.setResolveSnapshotPath((testFile) => {
return join(process.cwd(), `${basename(testFile)}.snapshot`);
});
test('has a snapshot', (t) => {
t.assert.snapshot('a snapshot from ' + __filename);
});

View File

@ -0,0 +1,30 @@
'use strict';
const { snapshot, suite, test } = require('node:test');
const { basename, join } = require('node:path');
snapshot.setResolveSnapshotPath((testFile) => {
return join(process.cwd(), `${basename(testFile)}.snapshot`);
});
suite('suite', () => {
test('test with plan', (t) => {
t.plan(2);
t.assert.snapshot({ foo: 1, bar: 2 });
t.assert.snapshot(5);
});
});
test('test', async (t) => {
t.assert.snapshot({ baz: 9 });
});
test('`${foo}`', async (t) => {
const options = { serializers: [() => { return '***'; }]};
t.assert.snapshot('snapshotted string', options);
});
test('escapes in `\\${foo}`\n', async (t) => {
t.assert.snapshot('`\\${foo}`\n');
});
require('./imported-tests');