From ff9170ab672df2237f4f13b776a9c0330c4c81e0 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 1 May 2025 08:57:21 +0000 Subject: [PATCH] fix(cleanup): Remove unused scratch files --- changelog.md | 6 ++++++ scratch-alias.js | 14 -------------- scratch-alias2.js | 20 -------------------- scratch-alias3.js | 8 -------- scratch-alias4.js | 8 -------- scratch-alias5.js | 10 ---------- scratch.js | 16 ---------------- ts/00_commitinfo_data.ts | 2 +- 8 files changed, 7 insertions(+), 77 deletions(-) delete mode 100644 scratch-alias.js delete mode 100644 scratch-alias2.js delete mode 100644 scratch-alias3.js delete mode 100644 scratch-alias4.js delete mode 100644 scratch-alias5.js delete mode 100644 scratch.js diff --git a/changelog.md b/changelog.md index 450aead..b17a0f3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # 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) Improve toHaveProperty alias by forwarding arguments correctly for intuitive object property assertions diff --git a/scratch-alias.js b/scratch-alias.js deleted file mode 100644 index 34bf04a..0000000 --- a/scratch-alias.js +++ /dev/null @@ -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); -} diff --git a/scratch-alias2.js b/scratch-alias2.js deleted file mode 100644 index f0e7c55..0000000 --- a/scratch-alias2.js +++ /dev/null @@ -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'); diff --git a/scratch-alias3.js b/scratch-alias3.js deleted file mode 100644 index 9c2acc1..0000000 --- a/scratch-alias3.js +++ /dev/null @@ -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'); diff --git a/scratch-alias4.js b/scratch-alias4.js deleted file mode 100644 index 8a0a5d3..0000000 --- a/scratch-alias4.js +++ /dev/null @@ -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'); diff --git a/scratch-alias5.js b/scratch-alias5.js deleted file mode 100644 index da1e61e..0000000 --- a/scratch-alias5.js +++ /dev/null @@ -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'); diff --git a/scratch.js b/scratch.js deleted file mode 100644 index 97ca204..0000000 --- a/scratch.js +++ /dev/null @@ -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); -} diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 2e0d19f..6cf23f9 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { 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.' }