ember-cli-yadda

raw JSON →
0.7.0 verified Sat Apr 25 auth: no javascript

Ember CLI addon (v0.7.0, latest) that integrates yadda with Ember's test suite for writing BDD tests in Gherkin. Supports QUnit and Mocha, generating acceptance/integration/unit feature files and step definitions. Requires Ember.js ≥3.20, Ember CLI ≥3.20, Node.js ≥12, and either ember-auto-import v2 or Embroider with custom webpack config. Key differentiators: provides blueprints, supports annotations, and is actively maintained by the Ember community.

error Cannot find module 'yadda'
cause Missing yadda npm package or incorrect import path.
fix
Install yadda: npm install --save-dev yadda and use import { yadda } from 'ember-cli-yadda' (v0.6+).
error AssertionError: expected false to be truthy
cause Test step callback not invoked correctly in QUnit.
fix
Ensure step functions call the callback (e.g., function(done) { ... done(); }) or return a promise.
error TypeError: yadda.yadda is not a function
cause Using old import path (helpers/yadda) instead of addon re-export.
fix
Replace with import { yadda } from 'ember-cli-yadda'.
error Module build failed: Error: Can't resolve 'path'
cause Embroider/webpack polyfills missing in Node environment.
fix
Add config.resolve.fallback: { path: require.resolve('path-browserify'), fs: false } to webpack config.
breaking In v0.7.0, ember-auto-import v2 is required. v1 is no longer supported.
fix Update to ember-auto-import v2 or use Embroider with custom webpack config.
breaking In v0.7.0, support for Ember 3.16 and Node 10 was dropped.
fix Use Ember 3.20+ and Node 12+.
breaking In v0.6.0, importing yadda from 'ember-cli-yadda' (the re-export) became the only supported pattern; the old helpers/yadda path was removed.
fix Replace all `import yadda from '../../helpers/yadda'` with `import { yadda } from 'ember-cli-yadda'`.
breaking In v0.5.0, ember-browserify was replaced by ember-auto-import. Manual cleanup needed.
fix Run `npm uninstall ember-browserify` and update imports to `import { yadda } from 'ember-cli-yadda'`.
breaking In v0.4.0, the testing API changed to RFC 232/268; older synchronous test patterns no longer work.
fix Rewrite tests to use modern `setupApplicationTest` hooks and async/await.
gotcha Embroider requires custom webpack config to resolve yadda's require() calls.
fix Add `config.resolve.fallback: { 'path': require.resolve('path-browserify'), 'fs': false }` to webpack config in ember-cli-build.js.
npm install ember-cli-yadda
yarn add ember-cli-yadda
pnpm add ember-cli-yadda

Install addon, generate a feature, and use yadda in a QUnit acceptance test.

ember install ember-cli-yadda\nember g feature acceptance-test\n# Write feature file in tests/acceptance/acceptance-test.feature\n# Then use in a test file:\nimport { yadda } from 'ember-cli-yadda';\nimport steps from './steps/steps';\nconst library = yadda.library(steps);\nmodule('Acceptance | bananas rot', function(hooks) {\n  setupApplicationTest(hooks);\n  test('bananas rot faster when next to apples', async function(assert) {\n    await yadda.yadda(library, new yadda.FeatureFileSearch('tests/acceptance').list(), assert);\n  });\n});