**refactor(tests): consolidate and replace outdated environment test scripts**

- Removed obsolete scripts: `test-all-environments.js`, `test-fallback-function.js`, `test-fallback-simple.js`, `test-fix.js`, `test-tensorflow-textencoder.js`, `test-unified-encoding.js`, and `test-worker-utils.js`.
- Introduced `scripts/comprehensive-test.js` as a unified testing script covering all environments: Browser, Node.js, and CLI.
- Added `examples/cli-wrapper-example.js` to demonstrate a proper CLI implementation with TensorFlow.js initialization.

This refactor simplifies the testing structure by consolidating redundant scripts into a single comprehensive script while ensuring robust cross-environment coverage.
This commit is contained in:
David Snelling 2025-07-14 11:12:51 -07:00
parent 3b85ea46e1
commit f5e4b8b93e
20 changed files with 1253 additions and 808 deletions

View file

@ -6,7 +6,12 @@
"module": "dist/unified.js",
"types": "dist/unified.d.ts",
"type": "module",
"sideEffects": false,
"sideEffects": [
"./dist/setup.js",
"./dist/utils/textEncoding.js",
"./src/setup.ts",
"./src/utils/textEncoding.ts"
],
"exports": {
".": {
"import": "./dist/unified.js",
@ -15,6 +20,10 @@
"./min": {
"import": "./dist/unified.min.js"
},
"./setup": {
"import": "./dist/setup.js",
"types": "./dist/setup.d.ts"
},
"./types/graphTypes": {
"import": "./dist/types/graphTypes.js",
"types": "./dist/types/graphTypes.d.ts"
@ -30,6 +39,10 @@
"./dist/utils/textEncoding.js": {
"import": "./dist/utils/textEncoding.js",
"types": "./dist/utils/textEncoding.d.ts"
},
"./dist/setup.js": {
"import": "./dist/setup.js",
"types": "./dist/setup.d.ts"
}
},
"engines": {
@ -61,9 +74,7 @@
"postinstall": "echo 'Note: If you encounter dependency conflicts with TensorFlow.js packages, please use: npm install --legacy-peer-deps'",
"dry-run": "npm pack --dry-run",
"test:cli": "node scripts/test-cli-locally.js",
"test:tensorflow": "node test-tensorflow-textencoder.js",
"test:all": "node scripts/test-all-environments.js",
"test": "npm run test:all"
"test": "node scripts/comprehensive-test.js"
},
"keywords": [
"vector-database",