{"_id":"@wdio/mocha-framework@9.33.1","bugs":{"url":"https://github.com/webdriverio/webdriverio/issues"},"dist":{"shasum":"87d8d95753e9a12984afef82a23f51fb3db746ed","tarball":"http://registry-npm.ywwl.com/@wdio/mocha-framework/download/@wdio/mocha-framework-9.33.1.tgz","fileCount":13,"integrity":"sha512-RiwgP//QURzuhJSLgBudZv1ASskCmo/UiJsXS0PtmOHvwfEDtAPygXX2LQNW1PuBVXMhjodb/TbcQENPDN9dyw==","signatures":[{"sig":"MEYCIQC4QP9bYj/8LTr9tITDHOV9oWP4l/N/XHhxkQcwPLQQfgIhAOtZHlKgrjSa+FWJ7Itu/GSUkqVxwYllKaSgMDEMUOOG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFAhqHFD9ZLWdf+zWoeCl3LMMgslLJ46hwNPbOFbrTJYAiEAqBI2Prb9+fwtL6B/qJbT7Fe2Hb9zKR5FTMlV/ZUoNKk="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@wdio%2fmocha-framework@9.33.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":31523,"size":9150,"noattachment":false,"key":"/@wdio/mocha-framework/-/@wdio/mocha-framework-9.33.1.tgz"},"name":"@wdio/mocha-framework","type":"module","types":"./build/index.d.ts","author":{"name":"Christian Bromann","email":"mail@bromann.dev"},"engines":{"node":">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1"},"exports":{".":{"types":"./build/index.d.ts","import":"./build/index.js"},"./common":{"import":"./build/common.js","source":"./src/common.ts"},"./package.json":"./package.json"},"gitHead":"c033b243414e716ab802161c79faa2e505f596e8","license":"MIT","version":"9.33.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"dd2c067c-9328-47bf-88d3-045bd2736b6a"}},"homepage":"https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-mocha-framework","keywords":["webdriver","wdio","wdio-reporter"],"repository":{"url":"git+https://github.com/webdriverio/webdriverio.git","type":"git","directory":"packages/wdio-mocha-framework"},"_npmVersion":"lerna/9.0.7/node@v24.22.2+x64 (linux)","description":"A WebdriverIO plugin. Adapter for Mocha testing framework.","directories":{},"maintainers":[{"name":"christian-bromann","email":"mail@bromann.dev"},{"name":"wdio-user","email":"bot@webdriver.io"},{"name":"wswebcreation-nl","email":"wim@wswebcreation.nl"}],"_nodeVersion":"24.22.2","dependencies":{"mocha":"^10.8.2","@types/node":"^20.11.28","@wdio/types":"9.33.1","@wdio/utils":"9.33.1","@types/mocha":"^10.0.10","@wdio/logger":"9.33.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","typeScriptVersion":"3.8.3","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mocha-framework_9.33.1_1793664160197_0.27356293087293226"},"readme":"WDIO Mocha Framework Adapter\n============================\n\n> A WebdriverIO plugin. Adapter for Mocha testing framework.\n\n## Installation\n\nThe easiest way is to keep `@wdio/mocha-framework` as a devDependency in your `package.json`, via:\n\n```sh\nnpm install @wdio/mocha-framework --save-dev\n```\n\nInstructions on how to install `WebdriverIO` can be found [here.](https://webdriver.io/docs/gettingstarted)\n\n## Configuration\n\nFollowing code shows the default wdio test runner configuration...\n\n```js\n// wdio.conf.js\nmodule.exports = {\n  // ...\n  framework: 'mocha',\n\n  mochaOpts: {\n    ui: 'bdd'\n  }\n  // ...\n};\n```\n\nNote that interfaces supported are `bdd`, `tdd` and `qunit`. If you want to provide a custom interface, it should expose methods compatible with them and be named ending with `-bdd`, `-tdd` or `-qunit` accordingly.\n\n## `mochaOpts` Options\n\nOptions will be passed to the Mocha instance. See the list of supported Mocha options [here](https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options).\n\n`failHookAffectedTests` defaults to `true`. When a `before` or `beforeEach` hook fails, the tests that hook skipped are reported as failed. Set `failHookAffectedTests: false` to report only the hook.\n\n----\n\n## `mochaOpts.require (string|string[])`\n\nThe `require` option is useful when you want to add or extend some basic functionality. <br />\nFor example, let's try to create an anonymous `describe`:\n\n**wdio.conf.js**\n\n```js\n{\n  suites: {\n    login: ['tests/login/*.js']\n  },\n\n  mochaOpts: {\n    require: './hooks/mocha.js'\n  }\n}\n```\n\n**./hooks/mocha.js**\n\n```js\nimport path from 'path';\n\nlet { context, file, mocha, options } = module.parent.context;\nlet { describe } = context;\n\ncontext.describe = function (name, callback) {\n\tif (callback) {\n\t\treturn describe(...arguments);\n\t} else {\n\t\tcallback = name;\n\t\tname = path.basename(file, '.js');\n\n\t\treturn describe(name, callback);\n\t}\n}\n```\n\n**./tests/TEST-XXX.js**\n\n```js\ndescribe(() => {\n\tit('Login form', function () => {\n\t\tthis.skip();\n\t});\n});\n```\n\n**Output**\n\n```\nTEST-XXX\n   ✓ Login form\n```\n\nFor more information on WebdriverIO see the [homepage](https://webdriver.io).\n","publish_time":1793664160329,"_cnpm_publish_time":1793664160329,"dist-tags":{"beta":"7.0.0-beta.4","latest":"10.2.0","latest-5":"5.23.0","next":"10.2.0-alpha.100.sha-b38abd894","v7":"7.40.0","v8":"8.46.0","v9":"9.33.1"}}