title: Webdriver.io - how to use beforeEach hooks in the config
body: <p>I am building an app using the MEAN stack and Webdriver for testing.</p>
  
  <p>At the moment I am cleaning the database between tests by using Mocha's beforeEach and afterEach hooks, e.g.:</p>
  
  <pre><code>describe('Links', function() {
    // drop DB collections
  
    beforeEach(function(done){
      //create database objects
    });
  
    afterEach(function(done){
      // drop DB collections
    });
  });
  </code></pre>
  
  <p>Is there a way of setting up wdio.conf.js for this to happen before and after each of my tests automatically? The config's <code>before:</code> and <code>after: function() {}</code> run as a beforeAll / afterAll rather than for each test.</p>