barrels.populate(['users'],function(err) { if (!err){ hooks.log("Test DB Populated"); } else { hooks.log("Error: Test DB not populated"); } done(err); });
hooks.after('Authentication > Log in > Create new token', function(transaction){ try{ const body = JSON.parse(transaction.real.body); bearer = body.Bearer; userId = body.User.id; hooks.log('Bearer = ' + bearer); hooks.log('UserID = ' + userId); } catch(e){ hooks.log('Can\'t get bearer, not valid json'); console.log(transaction.real.body); } });
hooks.beforeAll(function(transactions) { hooks.log("beforeAll"); // Populate the DB barrels.populate(['users'],function(err) { if (!err){ hooks.log("Test DB Populated"); } else { hooks.log("Error: Test DB not populated"); } done(err); }); });
hooks.afterEach(function(transaction) { hooks.log("afterEach.."); //db.cleanUp(); });
hooks.beforeAll(function(transactions) { hooks.log("beforeAll"); // Populate the DB barrels.populate(['users'],function(err) { if (!err){ hooks.log("Test DB Populated"); } else { hooks.log("Error: Test DB not populated"); } done(err); }); }); hooks.log("Start tests hooks.."); hooks.afterEach(function(transaction) { hooks.log("afterEach.."); //db.cleanUp(); }); /*before('Category > Delete a category', function() { db.createCategory({id:42}); }); before('Category Items > Create an item', function() { db.createCategory({id:42}); });*/
hooks.beforeAll(function (transactions, done) { hooks.log('before all'); done(); });
hooks.afterAll(function (transactions, done) { hooks.log('after all'); done(); })