fix(deps): Bump dependencies and migrate test fixtures to ts_web

This commit is contained in:
2025-11-30 18:20:47 +00:00
parent 5b7ba79724
commit a01b3ee122
7 changed files with 648 additions and 219 deletions

View File

@@ -1,44 +0,0 @@
// Test file to verify decorator functionality
function sealed(constructor: Function) {
Object.seal(constructor);
Object.seal(constructor.prototype);
}
@sealed
class TestClass {
name = 'test';
modify() {
this.name = 'modified';
}
}
// Test that the class is sealed
const instance = new TestClass();
console.log('Initial name:', instance.name);
// This should work (modifying existing property)
instance.modify();
console.log('Modified name:', instance.name);
// This should fail silently in non-strict mode or throw in strict mode
try {
(instance as any).newProperty = 'should not work';
console.log('Adding new property:', (instance as any).newProperty);
} catch (e) {
console.log('Error adding property (expected):', e.message);
}
// Test that we can't add to prototype
try {
(TestClass.prototype as any).newMethod = function () {};
console.log('Prototype is NOT sealed (unexpected)');
} catch (e) {
console.log('Prototype is sealed (expected)');
}
console.log('Is TestClass sealed?', Object.isSealed(TestClass));
console.log(
'Is TestClass.prototype sealed?',
Object.isSealed(TestClass.prototype),
);

View File

@@ -0,0 +1,36 @@
// Test file to verify decorator functionality
const decoratedClasses: Function[] = [];
function trackClass(constructor: Function) {
decoratedClasses.push(constructor);
return constructor;
}
function logMethod(_target: any, context: ClassMethodDecoratorContext) {
const methodName = String(context.name);
return function (this: any, ...args: any[]) {
console.log(`Calling method: ${methodName}`);
return (_target as Function).apply(this, args);
};
}
@trackClass
class TestClass {
name = 'test';
@logMethod
modify() {
this.name = 'modified';
}
}
// Test that the class decorator worked
const instance = new TestClass();
console.log('Initial name:', instance.name);
console.log('Class was decorated:', decoratedClasses.includes(TestClass));
// Test that the method decorator worked
instance.modify();
console.log('Modified name:', instance.name);
console.log('Decorator test completed successfully!');