Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mocha-runner-hooker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-runner-hooker - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

18

package.json
{
"name": "mocha-runner-hooker",
"version": "1.0.2",
"version": "1.0.3",
"description": "Additional functionality for each mocha test by hooks",

@@ -23,3 +23,17 @@ "main": "./build/index",

"url": "https://github.com/udarrr"
}
},
"keywords": [
"mocha",
"hook",
"hooks",
"runner",
"test",
"testing",
"before all",
"before each",
"after each",
"after all",
"globalSetup",
"globalTeardown"
]
}

33

README.md

@@ -22,27 +22,2 @@ # mocha-runner-hooker

```javascript
//without mocha-runner-hooker
describe('Suite', function () {
it('Test 1', async () => {
console.log('test 1');
});
});
```
```javascript
//with mocha-runner-hooker
describe('Suite', function () {
before(async function () {}); //on fly
before(async function () {}); //on fly
beforeEach(async function () {}); //on fly
afterEach(async function () {}); //on fly
after(async function () {}); //on fly
after(async function () {}); //on fly
it('Test 1', async () => {
console.log('test 1');
});
});
```
## Add new hooks to runner

@@ -57,3 +32,3 @@

hookType: 'before all',
hookTitle: 'skip option',
hookTitle: 'hello',
order: 'Top',

@@ -66,3 +41,3 @@ hookFn: () => {

hookType: 'after all',
hookTitle: 'skip option',
hookTitle: 'hello',
order: 'Top',

@@ -75,3 +50,3 @@ hookFn: () => {

hookType: 'after each',
hookTitle: 'skip option',
hookTitle: 'hello',
order: 'Top',

@@ -84,3 +59,3 @@ hookFn: () => {

hookType: 'before each',
hookTitle: 'skip option',
hookTitle: 'hello',
order: 'Top',

@@ -87,0 +62,0 @@ hookFn: () => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc