Skip to content

Commit e9a7345

Browse files
committed
docs: add development and testing sections to README; update build script to run tests before building
1 parent d40d898 commit e9a7345

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,41 @@ Or install via npm and import:
647647
import { Poline, PolinePicker } from 'poline/dist/picker.mjs';
648648
```
649649

650+
## Development
651+
652+
### Testing
653+
654+
"**poline**" includes a comprehensive test suite to ensure reliability and correctness. Tests are written using [Vitest](https://vitest.dev/) and cover all major functionality including:
655+
656+
- ColorPoint class operations
657+
- HSL/XYZ coordinate conversions
658+
- Position functions and easing
659+
- Palette generation and manipulation
660+
- Anchor point management
661+
- Edge cases and error handling
662+
663+
To run the tests:
664+
665+
```bash
666+
npm test
667+
```
668+
669+
Tests are automatically run before building to ensure code quality.
670+
671+
### Building
672+
673+
To build the project:
674+
675+
```bash
676+
npm run build
677+
```
678+
679+
This will:
680+
1. Run the test suite
681+
2. Lint and format check the code
682+
3. Compile TypeScript to JavaScript
683+
4. Generate all distribution bundles (ESM, CommonJS, UMD, minified versions)
684+
650685
## License
651686

652687
And thus, the tome of "**poline**" has been written. Its mystical powers, steeped in the arcane knowledge of the ancients, now reside within these pages. May this compendium serve you in your quest for the ultimate color palette.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"types": "dist/index.d.ts",
2323
"scripts": {
24-
"build": "npm run lint && tsc --build && node ./build.js",
24+
"build": "npm test && npm run lint && tsc --build && node ./build.js",
2525
"test": "vitest run",
2626
"lint": "eslint . --ext .ts && npx prettier --check ./src/",
2727
"prettier": "npx prettier --write ./src/",

0 commit comments

Comments
 (0)