Compare commits

..

No commits in common. "e2c02cb32c7a9cf68afdb4caaeb0e64b4398134e" and "26311992d396611c67e6eaef24402646a1a06b74" have entirely different histories.

2 changed files with 6 additions and 15 deletions

View File

@ -3,7 +3,6 @@
"module": "index.ts", "module": "index.ts",
"type": "module", "type": "module",
"devDependencies": { "devDependencies": {
"@faker-js/faker": "^8.3.1",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
"@types/express-list-endpoints": "^6.0.3", "@types/express-list-endpoints": "^6.0.3",
"@types/jest": "^29.5.11", "@types/jest": "^29.5.11",

View File

@ -1,20 +1,12 @@
import authModel from "../src/models/AuthModel"; import authModel from "../src/models/AuthModel";
import imageModel, { Image } from "../src/models/ImageModel"; import imageModel from "../src/models/ImageModel";
import { faker } from '@faker-js/faker';
export default async function () { export default async function () {
const images = faker.helpers.multiple(() => ({ await imageModel.create({
url: faker.helpers.unique(faker.internet.url), url: "https://example.com",
status: faker.helpers.arrayElement(["available", "unavailable", "consumed"]), status: "consumed",
tags: faker.helpers.arrayElements([ tags: ["2girls", "sleeping"],
"2girls", "sleeping", "touhou", });
"pokemon", "closed_eyes", "yume_nikki",
"waifu", "computer", "party", "yuru_camp"
], { min: 0, max: 5 }),
}), {count: {min: 5, max:50}});
// Wait until all images are inserted
await Promise.allSettled(images.map(image => imageModel.create(image)));
await authModel.create({ await authModel.create({
app: "tester", app: "tester",