Download dist/tests/UserDataBaseTests.test.js from ItsMa8di/idbot: direct link, hf CLI and curl.
- Browser
- Download file 1.55 kB
-
https://huggingface.co/spaces/ItsMa8di/idbot/resolve/main/dist/tests/UserDataBaseTests.test.js
- Command line
-
hf download hf://spaces/ItsMa8di/idbot/dist/tests/UserDataBaseTests.test.js
-
curl -L -o UserDataBaseTests.test.js https://huggingface.co/spaces/ItsMa8di/idbot/resolve/main/dist/tests/UserDataBaseTests.test.js
1.55 kB
| ; | |
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | |
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | |
| return new (P || (P = Promise))(function (resolve, reject) { | |
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | |
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | |
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | |
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | |
| }); | |
| }; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| const vitest_1 = require("vitest"); | |
| const userController_1 = require("../controllers/userController"); | |
| const databaseConnection_1 = require("../utils/databaseConnection"); | |
| (0, vitest_1.describe)("user test", () => { | |
| (0, vitest_1.it)("update user", () => __awaiter(void 0, void 0, void 0, function* () { | |
| (0, databaseConnection_1.connectToDatabase)("mongodb://localhost:27017/idbot"); | |
| const user = yield userController_1.UserController.getByUserid(1919092823); | |
| if (!user) { | |
| console.log("no user"); | |
| return; | |
| } | |
| console.log(user); | |
| const updatedUser = Object.assign(Object.assign({}, user), { savedAccountTag: "12344" }); | |
| yield userController_1.UserController.updateByUserid(1919092823, updatedUser); | |
| })); | |
| }); | |