{"_id":"@-fflow/core","name":"@-fflow/core","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@-fflow/core","version":"1.1.0","description":"Core BDD testing package for fflow - Behavior-Driven Development tests in JavaScript","type":"module","main":"index.js","scripts":{"test":"cucumber-js","test:watch":"cucumber-js --watch","test:tags":"cucumber-js --tags","test:dry-run":"cucumber-js --dry-run","test:parallel":"cucumber-js --parallel 2","report":"mkdir -p reports && cucumber-js"},"repository":{"type":"git","url":"git+https://github.com/get-fflow/core.git"},"keywords":["bdd","testing","cucumber","fflow","behavior-driven-development","gherkin"],"author":{"name":"fflow team"},"license":"ISC","bugs":{"url":"https://github.com/get-fflow/core/issues"},"homepage":"https://github.com/get-fflow/core#readme","publishConfig":{"access":"public"},"devDependencies":{"@cucumber/cucumber":"^11.1.0","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^12.0.1","chai":"^5.1.2","conventional-changelog-conventionalcommits":"^9.0.0","semantic-release":"^24.2.5"},"engines":{"node":">=14.0.0"},"_id":"@-fflow/core@1.1.0","gitHead":"9b6b8eab654075d509e44a72978ee09e76427c69","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-V/t963W59M6FyrSrrpQfX5JYB34iAbKo7X34aw7rExjKBWH7Pc6txPZWpkdq0LqWEn3bd6LXsQpIlvOG5PxTFg==","shasum":"3f863e21b7438b9e2f2cdfb8b711d72941d64aad","tarball":"https://registry.npmjs.org/@-fflow/core/-/core-1.1.0.tgz","fileCount":9,"unpackedSize":12015,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICm70au1FOj+xA2SlLuCsPrRWDC/XA4ERqcXJmD7ONfUAiBghxQnMW2KUCUHxsP+DVdmgR6OawvALTDvOxk5q8fVmg=="}]},"_npmUser":{"name":"mpellouin","email":"maxence.pellouin@epitech.eu","actor":{"name":"mpellouin","email":"maxence.pellouin@epitech.eu","type":"user"}},"directories":{},"maintainers":[{"name":"mpellouin","email":"maxence.pellouin@epitech.eu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_1.1.0_1750434837255_0.8200963535825267"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-20T15:53:56.868Z","1.1.0":"2025-06-20T15:53:57.464Z","modified":"2025-06-20T15:53:57.737Z"},"maintainers":[{"name":"mpellouin","email":"maxence.pellouin@epitech.eu"}],"description":"Core BDD testing package for fflow - Behavior-Driven Development tests in JavaScript","homepage":"https://github.com/get-fflow/core#readme","keywords":["bdd","testing","cucumber","fflow","behavior-driven-development","gherkin"],"repository":{"type":"git","url":"git+https://github.com/get-fflow/core.git"},"author":{"name":"fflow team"},"bugs":{"url":"https://github.com/get-fflow/core/issues"},"license":"ISC","readme":"# @fflow/core\n\nCore is the main component of fflow, providing a comprehensive BDD (Behavior-Driven Development) testing framework for JavaScript applications.\n\n## Features\n\n- 🥒 Built on Cucumber.js for industry-standard BDD testing\n- ✅ Integrated with Chai for powerful assertions\n- 🌍 Custom World implementation for scenario context management\n- 🎣 Hooks for setup and teardown operations\n- 📋 Multiple report formats (JSON, HTML, Progress)\n- 🔧 Easy-to-use API for creating custom step definitions\n\n## Installation\n\n```bash\nnpm install @fflow/core --save-dev\n```\n\n## Quick Start\n\n### 1. Create a feature file\n\nCreate a `.feature` file in your `features` directory:\n\n```gherkin\nFeature: User Authentication\n  As a user\n  I want to log in to the system\n  So that I can access my account\n\n  Scenario: Successful login\n    Given I am on the login page\n    When I enter valid credentials\n    Then I should be redirected to the dashboard\n```\n\n### 2. Write step definitions\n\n```javascript\nconst { Given, When, Then, expect } = require('@fflow/core');\n\nGiven('I am on the login page', function() {\n  // Navigate to login page\n  this.setContext('currentPage', '/login');\n});\n\nWhen('I enter valid credentials', function() {\n  // Simulate entering credentials\n  const credentials = {\n    username: 'user@example.com',\n    password: 'password123'\n  };\n  this.setContext('credentials', credentials);\n});\n\nThen('I should be redirected to the dashboard', function() {\n  // Verify redirection\n  const currentPage = this.getContext('currentPage');\n  expect(currentPage).to.equal('/dashboard');\n});\n```\n\n### 3. Run your tests\n\n```bash\nnpm test\n```\n\n## API Reference\n\n### Step Definitions\n\n```javascript\nconst { Given, When, Then } = require('@fflow/core');\n\nGiven('a precondition', function() {\n  // Setup code\n});\n\nWhen('an action occurs', function() {\n  // Action code\n});\n\nThen('expect a result', function() {\n  // Assertion code\n});\n```\n\n### World Context\n\nThe World provides isolated context for each scenario:\n\n```javascript\n// Store data\nthis.setContext('key', value);\n\n// Retrieve data\nconst value = this.getContext('key');\n\n// Clear all context\nthis.clearContext();\n\n// Access Chai expect\nthis.expect(actual).to.equal(expected);\n```\n\n### Hooks\n\n```javascript\nconst { Before, After, BeforeAll, AfterAll } = require('@fflow/core');\n\nBeforeAll(function() {\n  // Runs once before all scenarios\n});\n\nBefore(function() {\n  // Runs before each scenario\n});\n\nAfter(function(scenario) {\n  // Runs after each scenario\n});\n\nAfterAll(function() {\n  // Runs once after all scenarios\n});\n```\n\n### Custom World\n\nCreate a custom World class with additional functionality:\n\n```javascript\nconst { createWorld, setWorldConstructor } = require('@fflow/core');\n\nconst CustomWorld = createWorld({\n  // Add custom properties or methods\n  apiClient: null,\n  \n  async makeRequest(endpoint) {\n    // Custom method\n    return await this.apiClient.get(endpoint);\n  }\n});\n\nsetWorldConstructor(CustomWorld);\n```\n\n## Configuration\n\nCreate a `cucumber.js` file in your project root:\n\n```javascript\nmodule.exports = {\n  default: {\n    require: [\n      'features/step_definitions/**/*.js',\n      'features/support/**/*.js'\n    ],\n    format: [\n      'progress',\n      'json:reports/cucumber_report.json',\n      'html:reports/cucumber_report.html'\n    ],\n    publishQuiet: true\n  }\n};\n```\n\n## Available Scripts\n\n- `npm test` - Run all tests\n- `npm run test:watch` - Run tests in watch mode\n- `npm run test:dry-run` - Validate feature files without executing\n- `npm run test:parallel` - Run tests in parallel\n- `npm run test:tags @tagname` - Run specific tagged scenarios\n- `npm run report` - Generate test reports\n\n## Project Structure\n\n```\nyour-project/\n├── features/\n│   ├── step_definitions/\n│   │   └── your_steps.js\n│   ├── support/\n│   │   ├── world.js\n│   │   └── hooks.js\n│   └── your.feature\n├── cucumber.js\n└── package.json\n```\n\n## Best Practices\n\n1. **Keep scenarios focused**: Each scenario should test one specific behavior\n2. **Use Background wisely**: Only include steps that are truly common to all scenarios\n3. **Write declarative scenarios**: Focus on what, not how\n4. **Reuse step definitions**: Create generic, reusable steps when possible\n5. **Use tags for organization**: Tag features and scenarios for selective execution\n\n## Example Project\n\nCheck out the included example in the `features` directory to see a working calculator implementation with:\n- Feature file with multiple scenarios\n- Step definitions\n- World context usage\n- Scenario outlines with examples\n\n## Contributing\n\nPlease submit issues and pull requests to the [fflow/core repository](https://github.com/get-fflow/core).\n\n## License\n\nISC\n","readmeFilename":"README.MD","_rev":"1-7d3478ee52012a77bb3f54b1f904312f"}