{"name":"@wdio/mocha-framework","version":"7.12.0","keywords":["webdriver","wdio","wdio-reporter"],"author":{"name":"Christian Bromann","email":"christian@saucelabs.com"},"license":"MIT","_id":"@wdio/mocha-framework@7.12.0","maintainers":[{"name":"christian-bromann","email":"christian@saucelabs.com"},{"name":"wdio-user","email":"christian+webdriverio@saucelabs.com"},{"name":"wswebcreation-nl","email":"wim@wswebcreation.nl"}],"homepage":"https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-mocha-framework","bugs":{"url":"https://github.com/webdriverio/webdriverio/issues"},"dist":{"shasum":"b63a5cecee4119fe1060f82f9be5d110bc0deba8","tarball":"http://registry-npm.ywwl.com/@wdio/mocha-framework/download/@wdio/mocha-framework-7.12.0.tgz","fileCount":15,"integrity":"sha512-sVWSLO6o2jJnXsPErPJ4FvdNwjaPJ8gnTji5hvzpOGiut9Bx7iDT4wcc6lMKUyf2Zm+1/bE/Kfir7n9+OldcYw==","signatures":[{"sig":"MEQCIBa8INPRKtNNZByK0WOiPUz0mx+gKZcmgPgG2VW22HH8AiBjsOBf5g3OXG+bLp//wWC+7i+Ti7bCJ2hJyTzcwClvmA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNei0CRA9TVsSAnZWagAAa80QAKF/EMOqond8dnwAaCFe\nE+jd/mQtwMGAKQj/kZY5TcW4aPYrua1k0PeXrU+/QTcmIuL/nMSLOcLOU2bf\nRyJy2Fdj4DaSH63jZkuxnXbOQQg7B6kGiJVas0N3Li/UWeYeZBs9fwg4LSCh\nEu1FVtUWuVjAjXcuRgW8TEuFN43U3o/HGMDwgrIc+hVBf7jpIcIHjrSEm/RB\nAznlSouwG2tb2n8YmwuMVrlXMnDLEYXl5OC2kEuLGcR4isDsYC6jnKAA2smn\nHOZJIZInfsxewOdQK6zzpdKrTZCX7k/7FIhFOG67lNZoV0L+X7qc5/jdb4EB\nxeMm0JRe8ovZkU/ryxH8BMCwBEubl/TDZ9oWbym/0loMc6Mkatgbx5E0L6AS\nD6ELiQYbXp1vf7d88kAxHfb7RyUMBvBfEdWo2o+jSh01Ad4tWfy73sTRY7Sc\nxKd4ygV6l3OhcJfo8Bg9u4xYVP4A/f2EuMjj5HXmsfI4HukQ0heH53pRbn8c\n3Rujmdbk0s2OzqjeK7qCxocquNHKibY2z5OEnyAP6pW10KNILtzBs88YJZ0Q\n2iMT3L39RGJWWS/lpMMqEhw04NuUJC+xH92XP97V9R9RQWC6EzyTKLgoBXc4\nQ42g3uLVRxsKyoM7NWAUrJd4HDz632oLiqpH+W7HS2uS6aNlvnl1LLYeVWj8\n+/VN\r\n=oEsS\r\n-----END PGP SIGNATURE-----\r\n","size":9398,"noattachment":false,"key":"/@wdio/mocha-framework/-/@wdio/mocha-framework-7.12.0.tgz"},"main":"./build/index","types":"./build/index.d.ts","engines":{"node":">=12.0.0"},"gitHead":"c13eb971503eca5d59b74d38678cec3bd34018b4","_npmUser":{"name":"wdio-user","email":"christian+webdriverio@saucelabs.com"},"repository":{"url":"git://github.com/webdriverio/webdriverio.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","description":"A WebdriverIO plugin. Adapter for Mocha testing framework.","directories":{},"_nodeVersion":"14.17.6","dependencies":{"mocha":"^9.0.0","@wdio/types":"7.10.1","@wdio/utils":"7.12.0","@types/mocha":"^9.0.0","@wdio/logger":"7.7.0","expect-webdriverio":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^15.12.5"},"_npmOperationalInternal":{"tmp":"tmp/mocha-framework_7.12.0_1630922931939_0.6296091000451636","host":"s3://npm-registry-packages"},"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":1630922932085,"_cnpm_publish_time":1630922932085,"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"}}