fix(build): Corrected package.json and workflow dependencies and resolved formatting issues in tests.
This commit is contained in:
parent
5801d34f18
commit
ed9a9b7f2c
@ -119,6 +119,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npmci node install stable
|
npmci node install stable
|
||||||
npmci npm install
|
npmci npm install
|
||||||
pnpm install -g @gitzone/tsdoc
|
pnpm install -g @git.zone/tsdoc
|
||||||
npmci command tsdoc
|
npmci command tsdoc
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-03-04 - 1.6.1 - fix(build)
|
||||||
|
Corrected package.json and workflow dependencies and resolved formatting issues in tests.
|
||||||
|
|
||||||
|
- Fixed incorrect global npm package reference for tsdoc installation in workflow file.
|
||||||
|
- Updated dependencies in package.json for consistency in package naming.
|
||||||
|
- Resolved inconsistent formatting and spacing in test files.
|
||||||
|
|
||||||
## 2025-03-04 - 1.6.0 - feat(assertion)
|
## 2025-03-04 - 1.6.0 - feat(assertion)
|
||||||
Enhanced the assertion error messaging and added new test cases.
|
Enhanced the assertion error messaging and added new test cases.
|
||||||
|
|
||||||
|
10
package.json
10
package.json
@ -10,14 +10,14 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --web)",
|
"test": "(tstest test/ --web)",
|
||||||
"build": "(tsbuild --web)",
|
"build": "(tsbuild tsfolders)",
|
||||||
"buildDocs": "tsdoc"
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.66",
|
"@git.zone/tsbuild": "^2.2.1",
|
||||||
"@gitzone/tsbundle": "^2.0.8",
|
"@git.zone/tsbundle": "^2.2.5",
|
||||||
"@gitzone/tsrun": "^1.2.44",
|
"@git.zone/tsrun": "^1.3.3",
|
||||||
"@gitzone/tstest": "^1.0.77",
|
"@git.zone/tstest": "^1.0.96",
|
||||||
"@push.rocks/tapbundle": "^5.5.6",
|
"@push.rocks/tapbundle": "^5.5.6",
|
||||||
"@types/node": "^22.13.9"
|
"@types/node": "^22.13.9"
|
||||||
},
|
},
|
||||||
|
3182
pnpm-lock.yaml
generated
3182
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -76,9 +76,9 @@ tap.test('object property assertions', async () => {
|
|||||||
nested: {
|
nested: {
|
||||||
prop: 42,
|
prop: 42,
|
||||||
deeplyNested: {
|
deeplyNested: {
|
||||||
array: [1, 2, 3]
|
array: [1, 2, 3],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Basic property checks
|
// Basic property checks
|
||||||
@ -88,13 +88,24 @@ tap.test('object property assertions', async () => {
|
|||||||
|
|
||||||
// Drill-down property navigation
|
// Drill-down property navigation
|
||||||
smartexpect.expect(testObject).property('nested').toHaveProperty('prop', 42);
|
smartexpect.expect(testObject).property('nested').toHaveProperty('prop', 42);
|
||||||
smartexpect.expect(testObject).property('nested').property('deeplyNested').property('array').toBeArray();
|
smartexpect
|
||||||
|
.expect(testObject)
|
||||||
|
.property('nested')
|
||||||
|
.property('deeplyNested')
|
||||||
|
.property('array')
|
||||||
|
.toBeArray();
|
||||||
|
|
||||||
// Deep property checks
|
// Deep property checks
|
||||||
smartexpect.expect(testObject).toHaveDeepProperty(['nested', 'deeplyNested', 'array']);
|
smartexpect.expect(testObject).toHaveDeepProperty(['nested', 'deeplyNested', 'array']);
|
||||||
|
|
||||||
// Array item navigation
|
// Array item navigation
|
||||||
smartexpect.expect(testObject).property('nested').property('deeplyNested').property('array').arrayItem(0).toEqual(1);
|
smartexpect
|
||||||
|
.expect(testObject)
|
||||||
|
.property('nested')
|
||||||
|
.property('deeplyNested')
|
||||||
|
.property('array')
|
||||||
|
.arrayItem(0)
|
||||||
|
.toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('numeric comparison assertions', async () => {
|
tap.test('numeric comparison assertions', async () => {
|
||||||
@ -155,7 +166,9 @@ tap.test('boolean assertions', async () => {
|
|||||||
|
|
||||||
tap.test('function assertions', async () => {
|
tap.test('function assertions', async () => {
|
||||||
// Function that throws
|
// Function that throws
|
||||||
const throwingFn = () => { throw new Error('test error'); };
|
const throwingFn = () => {
|
||||||
|
throw new Error('test error');
|
||||||
|
};
|
||||||
smartexpect.expect(throwingFn).toThrow();
|
smartexpect.expect(throwingFn).toThrow();
|
||||||
smartexpect.expect(throwingFn).toThrow(Error);
|
smartexpect.expect(throwingFn).toThrow(Error);
|
||||||
|
|
||||||
@ -176,15 +189,10 @@ tap.test('date assertions', async () => {
|
|||||||
|
|
||||||
tap.test('custom assertions', async () => {
|
tap.test('custom assertions', async () => {
|
||||||
// Custom validation logic
|
// Custom validation logic
|
||||||
smartexpect.expect(42).customAssertion(
|
smartexpect.expect(42).customAssertion((value) => value % 2 === 0, 'Expected number to be even');
|
||||||
value => value % 2 === 0,
|
|
||||||
'Expected number to be even'
|
|
||||||
);
|
|
||||||
|
|
||||||
// With fail message
|
// With fail message
|
||||||
smartexpect.expect('test')
|
smartexpect.expect('test').setFailMessage('Custom fail message for assertion').toHaveLength(4);
|
||||||
.setFailMessage('Custom fail message for assertion')
|
|
||||||
.toHaveLength(4);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('logging and debugging', async () => {
|
tap.test('logging and debugging', async () => {
|
||||||
@ -192,13 +200,19 @@ tap.test('logging and debugging', async () => {
|
|||||||
const complexObject = {
|
const complexObject = {
|
||||||
level1: {
|
level1: {
|
||||||
level2: {
|
level2: {
|
||||||
value: 'nested value'
|
value: 'nested value',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// This logs the current value in the chain for debugging
|
// This logs the current value in the chain for debugging
|
||||||
smartexpect.expect(complexObject).property('level1').property('level2').log().property('value').toEqual('nested value');
|
smartexpect
|
||||||
|
.expect(complexObject)
|
||||||
|
.property('level1')
|
||||||
|
.property('level2')
|
||||||
|
.log()
|
||||||
|
.property('value')
|
||||||
|
.toEqual('nested value');
|
||||||
});
|
});
|
||||||
|
|
||||||
export default tap.start();
|
export default tap.start();
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartexpect',
|
name: '@push.rocks/smartexpect',
|
||||||
version: '1.6.0',
|
version: '1.6.1',
|
||||||
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.'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user