{"_id":"@alban225/testlyn","name":"@alban225/testlyn","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@alban225/testlyn","version":"0.1.0","description":"CLI-based API testing tool using YAML syntax. Write tests declaratively in YAML, run them with confidence.","type":"module","main":"src/index.js","bin":{"testlyn":"bin/cli.js"},"scripts":{"start":"node bin/cli.js","test":"node --test tests/**/*.test.js","dev":"node bin/cli.js --watch","lint":"eslint src bin tests"},"keywords":["api-testing","yaml","testing","cli","http","integration-testing"],"author":{"name":"Alban Okoby"},"license":"MIT","engines":{"node":">=24.0.0"},"dependencies":{"axios":"^1.6.0","yaml":"^2.3.0","chalk":"^5.3.0","commander":"^11.0.0"},"devDependencies":{"eslint":"^8.50.0"},"repository":{"type":"git","url":"git+https://github.com/alban-okoby/testlyn.git"},"bugs":{"url":"https://github.com/alban-okoby/testlyn/issues"},"homepage":"https://github.com/alban-okoby/testlyn#readme","_id":"@alban225/testlyn@0.1.0","gitHead":"9f2f3c0f9d735c95e5c695cc56e39013786e213a","_nodeVersion":"24.0.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-yMQDknZqog9ITCKZAANu1smbx9Qnr7uc6A0FXPz1DZGegYLOT9uU+5JDZQ2XX1pgTr4qck78xUSn+TgQVMrWOQ==","shasum":"1a7c14b73d0f9f6b6008f80969721a78dd06a658","tarball":"https://registry.npmjs.org/@alban225/testlyn/-/testlyn-0.1.0.tgz","fileCount":15,"unpackedSize":40065,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDDImUStfnAG8kl0+owUtRkLmckLmCAovmcHf/X4sunBAIhAL7a5kwxZFosRFrjasFabPylUCDno5tHPu7Ai4UeYHLi"}]},"_npmUser":{"name":"alban225","email":"albanokoby225@gmail.com"},"directories":{},"maintainers":[{"name":"alban225","email":"albanokoby225@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/testlyn_0.1.0_1789051791291_0.5334059093182557"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-10T14:49:51.056Z","0.1.0":"2026-09-10T14:49:51.425Z","modified":"2026-09-10T14:49:51.807Z"},"maintainers":[{"name":"alban225","email":"albanokoby225@gmail.com"}],"description":"CLI-based API testing tool using YAML syntax. Write tests declaratively in YAML, run them with confidence.","homepage":"https://github.com/alban-okoby/testlyn#readme","keywords":["api-testing","yaml","testing","cli","http","integration-testing"],"repository":{"type":"git","url":"git+https://github.com/alban-okoby/testlyn.git"},"author":{"name":"Alban Okoby"},"bugs":{"url":"https://github.com/alban-okoby/testlyn/issues"},"license":"MIT","readme":"# Testlyn 🧪\n\n**CLI-based API testing tool using YAML syntax**\n\nWrite tests declaratively in YAML, run them with confidence. No boilerplate. No hassle.\n\n## Quick Start\n\n```bash\nnpm install -g testlyn\n```\n\nCreate a `tests.yaml` file:\n\n```yaml\ntests:\n  - name: Check API Health\n    url: https://api.example.com/health\n    method: GET\n    expect:\n      status: 200\n\n  - name: Create Resource\n    url: https://api.example.com/resources\n    method: POST\n    headers:\n      Content-Type: application/json\n    body:\n      name: \"New Resource\"\n    expect:\n      status: 201\n```\n\nRun your tests:\n\n```bash\ntestlyn run tests.yaml\n```\n\n## Installation\n\n### Global (CLI usage)\n```bash\nnpm install -g testlyn\n```\n\n### Local (Project dependency)\n```bash\nnpm install --save-dev testlyn\n```\n\nThen in your `package.json`:\n```json\n{\n  \"scripts\": {\n    \"test:api\": \"testlyn run tests.yaml\"\n  }\n}\n```\n\n## Usage\n\n### Basic Command\n\n```bash\ntestlyn run <file.yaml>\n```\n\n### Options\n\n- `-v, --verbose` — Show detailed output for each test\n- `-s, --stop-on-error` — Stop running tests on first failure\n\n### Examples\n\n```bash\n# Run with verbose output\ntestlyn run tests.yaml --verbose\n\n# Stop on first error\ntestlyn run tests.yaml --stop-on-error\n\n# Validate YAML syntax without running\ntestlyn validate tests.yaml\n\n# Initialize a new test project\ntestlyn init my-api-tests\n```\n\n## Test File Format\n\n### Basic Structure\n\n```yaml\ntests:\n  - name: Test Name\n    url: https://api.example.com/endpoint\n    method: GET\n    expect:\n      status: 200\n```\n\n### Complete Example\n\n```yaml\n# Test suite name (optional)\nsuite: User API Tests\n\n# Base URL (optional, can be used in all tests)\nbaseUrl: https://api.example.com\n\ntests:\n  - name: List Users\n    url: /users\n    method: GET\n    headers:\n      Authorization: Bearer YOUR_TOKEN\n    expect:\n      status: 200\n\n  - name: Create User\n    url: /users\n    method: POST\n    headers:\n      Content-Type: application/json\n      Authorization: Bearer YOUR_TOKEN\n    body:\n      email: user@example.com\n      name: John Doe\n    expect:\n      status: 201\n      body:\n        id: 1\n        email: user@example.com\n\n  - name: Delete User\n    url: /users/1\n    method: DELETE\n    expect:\n      status: 204\n```\n\n### Test Properties\n\n| Property | Required | Description |\n|----------|----------|-------------|\n| `name` | ✅ | Test name/description |\n| `url` | ✅ | Full URL or path (if baseUrl is set) |\n| `method` | ❌ | HTTP method: GET, POST, PUT, DELETE, PATCH (default: GET) |\n| `headers` | ❌ | HTTP headers as key-value pairs |\n| `body` | ❌ | Request body (JSON object or string) |\n| `expect` | ✅ | Expected response conditions |\n\n### Expect Properties\n\n```yaml\nexpect:\n  status: 200              # Expected HTTP status code\n  body:                    # Expected response body (partial match)\n    key: value\n```\n\n## Features\n\n- ✅ **Declarative Tests** — Write tests in simple YAML\n- ✅ **No Code Required** — No JavaScript knowledge needed\n- ✅ **Fast & Lightweight** — Minimal dependencies\n- ✅ **Clear Output** — Color-coded test results\n- ✅ **Easy CI/CD Integration** — Perfect for GitHub Actions, GitLab CI, etc.\n- ✅ **Status Code Assertions** — Verify HTTP responses\n- ✅ **Body Assertions** — Check response content\n- ✅ **Custom Headers** — Support for authentication, custom headers\n\n## Use Cases\n\n1. **Continuous Integration** — Validate APIs in your CI/CD pipeline\n2. **Contract Testing** — Verify API contracts between services\n3. **Smoke Testing** — Quick health checks for production APIs\n4. **Development** — Test your API while building\n5. **Documentation** — Keep tests as living API documentation\n\n## CI/CD Integration\n\n### GitHub Actions\n\n```yaml\nname: API Tests\n\non: [push]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: actions/setup-node@v3\n        with:\n          node-version: '18'\n      - run: npm install -g testlyn\n      - run: testlyn run tests.yaml\n```\n\n### GitLab CI\n\n```yaml\napi_tests:\n  image: node:18\n  script:\n    - npm install -g testlyn\n    - testlyn run tests.yaml\n```\n\n## Project Structure\n\n```\nmy-api-tests/\n├── tests.yaml           # Your test file\n├── package.json\n└── README.md\n```\n\n## Examples\n\n### Testing a REST API\n\n```yaml\ntests:\n  - name: Get User Profile\n    url: https://jsonplaceholder.typicode.com/users/1\n    method: GET\n    expect:\n      status: 200\n      body:\n        id: 1\n\n  - name: Create Post\n    url: https://jsonplaceholder.typicode.com/posts\n    method: POST\n    headers:\n      Content-Type: application/json\n    body:\n      userId: 1\n      title: Test Post\n      body: This is a test\n    expect:\n      status: 201\n```\n\n### Authentication\n\n```yaml\ntests:\n  - name: Login\n    url: https://api.example.com/auth/login\n    method: POST\n    headers:\n      Content-Type: application/json\n    body:\n      username: user@example.com\n      password: secret123\n    expect:\n      status: 200\n      body:\n        token: jwt_token\n\n  - name: Protected Endpoint\n    url: https://api.example.com/profile\n    method: GET\n    headers:\n      Authorization: Bearer jwt_token\n    expect:\n      status: 200\n```\n\n## Roadmap\n\n- [ ] Environment variables support (`.env` files)\n- [ ] Test dependencies (run tests in order, share data)\n- [ ] Response assertions (JSON path, regex matching)\n- [ ] Performance testing (response time assertions)\n- [ ] HTML report generation\n- [ ] Multi-format support (OpenAPI, Postman)\n- [ ] Retry logic for flaky tests\n- [ ] Parallel test execution\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nMIT © 2024\n\n## Support\n\n- 📖 [Documentation](https://github.com/alban-okoby/testlyn)\n- 🐛 [Issue Tracker](https://github.com/alban-okoby/testlyn/issues)\n- 💬 [Discussions](https://github.com/alban-okoby/testlyn/discussions)\n\n---\n\nBuilt with ❤️ in Abidjan\n","readmeFilename":"README.md","_rev":"1-bf654f88e5ff1face4db46b1dbe9d357"}