fix(cleanup): Remove unused scratch files

This commit is contained in:
Philipp Kunz 2025-05-01 08:57:21 +00:00
parent b68011b79d
commit ff9170ab67
8 changed files with 7 additions and 77 deletions

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## 2025-05-01 - 2.4.2 - fix(cleanup)
Remove unused scratch files
- Deleted scratch-alias.js, scratch-alias2.js, scratch-alias3.js, scratch-alias4.js, scratch-alias5.js, and scratch.js
- Clean up temporary alias and scratch test files
## 2025-04-30 - 2.4.1 - fix(Assertion) ## 2025-04-30 - 2.4.1 - fix(Assertion)
Improve toHaveProperty alias by forwarding arguments correctly for intuitive object property assertions Improve toHaveProperty alias by forwarding arguments correctly for intuitive object property assertions

View File

@ -1,14 +0,0 @@
import * as smartexpect from './dist_ts/index.js';
const obj = { topLevel: 'hello' };
try {
smartexpect.expect(obj).toHaveProperty('topLevel');
console.log('alias toHaveProperty succeeded');
} catch(err) {
console.error('alias toHaveProperty failed:', err.message);
}
try {
smartexpect.expect(obj).not.toHaveProperty('missing');
console.log('alias not.toHaveProperty succeeded');
} catch(err) {
console.error('alias not.toHaveProperty failed:', err.message);
}

View File

@ -1,20 +0,0 @@
import * as smartexpect from './dist_ts/index.js';
console.log('script start');
const obj = { topLevel: 'hello' };
console.log('script: after obj');
console.log('script: test for alias toHaveProperty');
try {
smartexpect.expect(obj).toHaveProperty('topLevel');
console.log('alias toHaveProperty succeeded');
} catch(err) {
console.error('alias toHaveProperty failed:', err.message);
}
console.log('script: after first try');
console.log('script: test for alias not.toHaveProperty');
try {
smartexpect.expect(obj).not.toHaveProperty('missing');
console.log('alias not.toHaveProperty succeeded');
} catch(err) {
console.error('alias not.toHaveProperty failed:', err.message);
}
console.log('script end');

View File

@ -1,8 +0,0 @@
import * as smartexpect from './dist_ts/index.js';
console.log('script start');
const obj = { topLevel: 'hello' };
console.log('script: test alias toHaveProperty');
const ret = smartexpect.expect(obj).toHaveProperty('topLevel');
console.log('got ret:', ret, 'typeof', typeof ret);
console.log('ret.then?', ret && typeof (ret as any).then);
console.log('script end');

View File

@ -1,8 +0,0 @@
import * as smartexpect from './dist_ts/index.js';
console.log('script start');
const obj = { topLevel: 'hello' };
console.log('script: test alias toHaveProperty');
const ret = smartexpect.expect(obj).toHaveProperty('topLevel');
console.log('got ret:', ret, 'typeof', typeof ret);
console.log('ret.then?', ret && ret.then);
console.log('script end');

View File

@ -1,10 +0,0 @@
import * as smartexpect from './dist_ts/index.js';
console.log('start');
const obj = { topLevel: 'hello' };
try {
smartexpect.expect(obj).toHaveProperty('topLevel');
console.log('success');
} catch (e) {
console.log('caught in catch:', e, e.message);
}
console.log('end');

View File

@ -1,16 +0,0 @@
import * as smartexpect from './dist_ts/index.js';
class Foo { constructor(){ this.foo='bar'; } }
console.log('foo in instance:', 'foo' in new Foo());
console.log('hasOwn foo:', Object.prototype.hasOwnProperty.call(new Foo(), 'foo'));
try {
smartexpect.expect(new Foo()).object.toHaveProperty('foo');
console.log('toHaveProperty passed');
} catch (err) {
console.error('toHaveProperty failed:', err.message);
}
try {
smartexpect.expect(new Foo()).object.toHaveOwnProperty('foo');
console.log('toHaveOwnProperty passed');
} catch (err) {
console.error('toHaveOwnProperty failed:', err.message);
}

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartexpect', name: '@push.rocks/smartexpect',
version: '2.4.1', version: '2.4.2',
description: 'A testing library to manage expectations in code, offering both synchronous and asynchronous assertion methods.' description: 'A testing library to manage expectations in code, offering both synchronous and asynchronous assertion methods.'
} }