Skip to content

Commit

Permalink
Añadiendo el usuario a la bd
Browse files Browse the repository at this point in the history
  • Loading branch information
iyanfdezz committed Apr 25, 2024
1 parent c680b7e commit 7020f11
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions webapp/e2e/test-environment-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ async function startServer() {
statsservice = await require("../../statsservice/stats-service");
authservice = await require("../../users/authservice/auth-service");
gatewayservice = await require("../../gatewayservice/gateway-service");

await mongoose.connect(mongoUri);
const existingUser = await User.findOne({ username: "testuser" });
if (!existingUser) {
const pass = await bcrypt.hash("Testpassword1", 10);
const newUser = new User({
username: "testuser",
password: pass,
});
await newUser.save();
}
}

startServer();

0 comments on commit 7020f11

Please sign in to comment.