{"name":"@wdio/mocha-framework","version":"6.10.10","keywords":["webdriver","wdio","wdio-reporter"],"author":{"name":"Christian Bromann","email":"christian@saucelabs.com"},"license":"MIT","_id":"@wdio/mocha-framework@6.10.10","maintainers":[{"name":"christian-bromann","email":"christian@saucelabs.com"},{"name":"wdio-user","email":"christian+webdriverio@saucelabs.com"}],"homepage":"https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-mocha-framework","bugs":{"url":"https://github.com/webdriverio/webdriverio/issues"},"dist":{"shasum":"55f356dbdd3046c472c6853a655e6b09daed11e4","tarball":"http://registry-npm.ywwl.com/@wdio/mocha-framework/download/@wdio/mocha-framework-6.10.10.tgz","fileCount":15,"integrity":"sha512-npUCZLPIQtXrZ1dgreV4gzWKiYad4fRwCAlCEjcAKm9g93HB/ZwbuqR9h7s/ohiFNiVD07KnukATFSM0I/NixA==","signatures":[{"sig":"MEUCIQCuElnLrm0TdV2PVzeYR5b55/qa1/GBT3GMA2xA5UzQ6AIgL0clqL97FNMyt7S6tmgWyQiKd360hglBb2/gNSfYgh8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1pBrCRA9TVsSAnZWagAAZLUP/3BzVFqQcHivuDUCSBUK\niCs5k7WERKA1hsvJSe3nsfwhaUsZyHNsCCHXF6Mr1YNmeBfw8zYW1ugdaNRg\ne3ciyzbAdH3+hjYIRncQE3VtaC7XtCBJAEI8UVqPJtfnLQ1B61TRf8VDS5T8\nVjSF9Msp61Z/A4DLuf7Rar61uGzo6L56roa0qw/yA2mbJ1knvNE54rTbf4Ls\n4LPbJeUUlxcH/x/nBp12KSn411KV3TMF/QBz83ht/rALeyRPla8W11j7PIug\nfjiSjQKnAqzCv3YoOm1xYzt91WC9KEKXdSI7cGMxtgq5tthGPLfL23p9ObgC\n8dxpc7bEAvolz0vHAzIeNvSJGmNgL4RGs33BBOqWT/DIuP/q0If2Y9lNeJtS\n7htNyyPUlVa3uxK8YoD5HswfNIJGA2sCJem4nq+tPyk2g4koORIzmuFZF7xH\n4Yc6Di0n3yKnF3RnScCe9JsujqmwHaOamGfmsYXUd0oJJPNKYhSqyR3be74U\ngyR4DR0exNXQObAFBb1BOq/KVpGccx/aJ7bYufYAEyPvGu00sHVvuFCC41v+\ntlos5lN2ffnKgWMFjQB++p+m5IRr3d5Uh0q9dUPAY9q7Q7m6weCtUJ624dE/\nLCEoIt5v2LMg1gB6NOg54iJ3NwoyhLNIbFn+tUhVqF6hdAqrjDhet6FSrqCN\n7BhN\r\n=0anB\r\n-----END PGP SIGNATURE-----\r\n","size":7910,"noattachment":false,"key":"/@wdio/mocha-framework/-/@wdio/mocha-framework-6.10.10.tgz"},"main":"./build/index","types":"mocha-framework.d.ts","engines":{"node":">=10.0.0"},"gitHead":"23272f7cd1ef7cd660d2eb6136d26b10b2b5104d","_npmUser":{"name":"wdio-user","email":"christian+webdriverio@saucelabs.com"},"repository":{"url":"git://github.com/webdriverio/webdriverio.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.20.0+x64 (linux)","description":"A WebdriverIO plugin. Adapter for Mocha testing framework.","directories":{},"_nodeVersion":"12.20.0","dependencies":{"mocha":"^8.0.1","@wdio/utils":"6.10.10","@types/mocha":"^8.0.0","@wdio/logger":"6.10.10","expect-webdriverio":"^1.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"webdriverio":"^6.0.1"},"_npmOperationalInternal":{"tmp":"tmp/mocha-framework_6.10.10_1607897195571_0.7526236471783214","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":1607897195684,"_cnpm_publish_time":1607897195684,"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"}}