nemar-cli 0.3.7-dev.110 → 0.3.7-dev.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/dist/index.js +46 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -372,14 +372,73 @@ graph TB
|
|
|
372
372
|
REL -->|Archive| DOI
|
|
373
373
|
```
|
|
374
374
|
|
|
375
|
+
## Testing
|
|
376
|
+
|
|
377
|
+
### Running Tests
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
# All tests
|
|
381
|
+
bun test
|
|
382
|
+
|
|
383
|
+
# Specific test file
|
|
384
|
+
bun test test/cli.test.ts
|
|
385
|
+
bun test test/api.test.ts
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Zenodo Sandbox Tests
|
|
389
|
+
|
|
390
|
+
DOI workflows can be tested using Zenodo's sandbox environment without affecting production:
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
# Run Zenodo sandbox tests (requires configuration)
|
|
394
|
+
RUN_ZENODO_TESTS=true TEST_DATASET_ID=nm099999 bun test test/zenodo-sandbox.test.ts
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**Setup requirements:**
|
|
398
|
+
1. Create account on [sandbox.zenodo.org](https://sandbox.zenodo.org)
|
|
399
|
+
2. Generate API token with `deposit:write` scope
|
|
400
|
+
3. Add to `test/.env.test`:
|
|
401
|
+
```bash
|
|
402
|
+
ZENODO_SANDBOX_API_KEY=your_sandbox_token
|
|
403
|
+
RUN_ZENODO_TESTS=true
|
|
404
|
+
TEST_DATASET_ID=nm099999
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Test coverage:**
|
|
408
|
+
- Concept DOI creation and retrieval
|
|
409
|
+
- Version DOI publishing workflows
|
|
410
|
+
- Metadata updates (title, keywords, related identifiers)
|
|
411
|
+
- Error handling (401, 404, 400 responses)
|
|
412
|
+
- Rate limiting and request throttling
|
|
413
|
+
- Deposition lifecycle (create → upload → publish)
|
|
414
|
+
- File uploads with checksum verification
|
|
415
|
+
|
|
416
|
+
See [docs/development/zenodo-testing.md](docs/development/zenodo-testing.md) for comprehensive guide.
|
|
417
|
+
|
|
375
418
|
## Environment Variables
|
|
376
419
|
|
|
420
|
+
### CLI Usage
|
|
421
|
+
|
|
377
422
|
```bash
|
|
378
423
|
NEMAR_API_KEY # API key (alternative to login)
|
|
379
424
|
NEMAR_API_URL # Custom API endpoint (default: https://api.nemar.org)
|
|
380
425
|
NEMAR_NO_COLOR # Disable colored output
|
|
381
426
|
```
|
|
382
427
|
|
|
428
|
+
### Testing
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
# Required for Zenodo sandbox tests
|
|
432
|
+
ZENODO_SANDBOX_API_KEY # Sandbox Zenodo API token
|
|
433
|
+
RUN_ZENODO_TESTS # Enable Zenodo tests (set to "true")
|
|
434
|
+
TEST_DATASET_ID # Test dataset ID (default: nm099999)
|
|
435
|
+
|
|
436
|
+
# API testing
|
|
437
|
+
TEST_API_URL # Test API endpoint (dev environment)
|
|
438
|
+
TEST_ADMIN_API_KEY # Admin API key for tests
|
|
439
|
+
TEST_USER_API_KEY # User API key for tests
|
|
440
|
+
```
|
|
441
|
+
|
|
383
442
|
## Troubleshooting
|
|
384
443
|
|
|
385
444
|
### Upload Issues
|