Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 918 Bytes

MIGRATION-3.0.0.MD

File metadata and controls

46 lines (31 loc) · 918 Bytes

Kakunin - automated testing framework

Migration to 3.0.0 version

What needs to be done:

  1. Change Hooks

In the version before 3.0.0 we had a single file located in the ./hook directory.

Example of hook.js:

const { Before, After } = require('kakunin');

Before(() => {
  console.log('If you can see this in console then hook is working properly.');
});

After(() => {
  console.log('Console log after the scenario');
});

Currently, the interface to set priorities has been added. So we can control if the hook FirstExample will be executed before SecondExample.

Example of first-example.hook.js:

const { hookHandlers, Before } = require('kakunin');

class FirstExampleHook {
  initializeHook() {
    Before(() => {
      console.log('First example hook');
    });
  }

  getPriority() {
    return 990;
  }
}

hookHandlers.addHook(new FirstExampleHook());