test(benchmarks): add C#/ASP.NET and TypeScript tasks
Six tasks with hidden checks: ASP.NET validation and 404 handling, C# cancellation, and TypeScript overlap, deep merge, and debounce fixes, checked with dotnet run and node --test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
97879fd6a5
commit
f43a2df14b
30 files changed
+349
-2
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { mergeConfig } from '../src/config.ts';
|
||||
|
||||
test('nested objects merge deeply', () => {
|
||||
const base = { server: { host: 'a', port: 1, tls: { on: true } }, tags: ['x'] };
|
||||
const override = { server: { port: 2, tls: { cert: 'c' } }, tags: ['y', 'z'] };
|
||||
assert.deepEqual(mergeConfig(base, override), { server: { host: 'a', port: 2, tls: { on: true, cert: 'c' } }, tags: ['y', 'z'] });
|
||||
});
|
||||
|
||||
test('inputs are not mutated', () => {
|
||||
const base = { a: { b: 1 } };
|
||||
const override = { a: { c: 2 } };
|
||||
mergeConfig(base, override);
|
||||
assert.deepEqual(base, { a: { b: 1 } });
|
||||
assert.deepEqual(override, { a: { c: 2 } });
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "config",
|
||||
"type": "module",
|
||||
"private": true
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export type Config = { [key: string]: unknown };
|
||||
|
||||
export function mergeConfig(base: Config, override: Config): Config {
|
||||
return { ...base, ...override };
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"prompt": "mergeConfig() drops nested settings from the base configuration when the override sets only some keys of a nested object. Merge nested objects deeply; arrays from the override replace base arrays, and neither input may be mutated.",
|
||||
"check": [
|
||||
"node",
|
||||
"--experimental-strip-types",
|
||||
"--no-warnings",
|
||||
"--test",
|
||||
"bench_hidden/check.test.ts"
|
||||
],
|
||||
"workflow": {
|
||||
"kind": "TypeScript change"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user