How to use the codeceptjs.event function in codeceptjs

To help you get started, we’ve selected a few codeceptjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esaude / esaude-emr-poc / test / e2eTests / hooks.js View on Github external
const event = require('codeceptjs').event;
const Apis = require('./rest/openMrsApis');

/**
 * Attaches handlers to Codeceptjs events.
 * All high level event handlers should be attached in this file.
 * Right now this function listens for when a test has completed
 * and cleans up any data that was injected into the database
 * during the test.
 */
module.exports = function() {
  /** After each test clean up data that was injected into the database */
  event.dispatcher.on(event.test.after, async (test) => {
  	try{
  		// Remove any and all data that was injected into the DB
	  	// after each test
	  	await Apis.cleanUp();

codeceptjs

Supercharged End 2 End Testing Framework for NodeJS

MIT
Latest version published 4 days ago

Package Health Score

92 / 100
Full package analysis