Updates to user cli + e2e + tests

- Updates to before + beforeEach for mongooose
- Removed reference to dotenv from cli in e2e, should use
  NODE_ENV=test instead.
- Changed test port from 30?? to 3000 to be consistent with what
  nightwatch was expecting
This commit is contained in:
Wyatt Johnson
2017-01-04 10:16:51 -07:00
parent a7680ae5d9
commit 298e1e8d73
6 changed files with 80 additions and 46 deletions
+10 -6
View File
@@ -80,12 +80,16 @@ function createUser(options) {
.then((user) => {
console.log(`Created user ${user.id}.`);
return User
.addRoleToUser(user.id, result.role.trim())
.then(() => {
console.log(`Added the admin ${result.role.trim()} to User ${user.id}.`);
util.shutdown();
});
if (result.role && result.role.length > 0) {
return User
.addRoleToUser(user.id, result.role.trim())
.then(() => {
console.log(`Added the admin ${result.role.trim()} to User ${user.id}.`);
util.shutdown();
});
} else {
util.shutdown();
}
})
.catch((err) => {
console.error(err);