Compare commits
No commits in common. "e2c02cb32c7a9cf68afdb4caaeb0e64b4398134e" and "26311992d396611c67e6eaef24402646a1a06b74" have entirely different histories.
e2c02cb32c
...
26311992d3
|
@ -3,7 +3,6 @@
|
|||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@faker-js/faker": "^8.3.1",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/express-list-endpoints": "^6.0.3",
|
||||
"@types/jest": "^29.5.11",
|
||||
|
|
|
@ -1,20 +1,12 @@
|
|||
import authModel from "../src/models/AuthModel";
|
||||
import imageModel, { Image } from "../src/models/ImageModel";
|
||||
import { faker } from '@faker-js/faker';
|
||||
import imageModel from "../src/models/ImageModel";
|
||||
|
||||
export default async function () {
|
||||
const images = faker.helpers.multiple(() => ({
|
||||
url: faker.helpers.unique(faker.internet.url),
|
||||
status: faker.helpers.arrayElement(["available", "unavailable", "consumed"]),
|
||||
tags: faker.helpers.arrayElements([
|
||||
"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 imageModel.create({
|
||||
url: "https://example.com",
|
||||
status: "consumed",
|
||||
tags: ["2girls", "sleeping"],
|
||||
});
|
||||
|
||||
await authModel.create({
|
||||
app: "tester",
|
||||
|
|
Loading…
Reference in New Issue