|
| 1 | +import { bench, describe } from "vitest"; |
| 2 | +import parsePr from "./parsePr"; |
| 3 | + |
| 4 | +const LONG_BODY = |
| 5 | + new Array(1_000) |
| 6 | + .fill( |
| 7 | + "Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt, earum. Atque architecto vero veniam est tempora fugiat sint quo praesentium quia. Autem, veritatis omnis beatae iste delectus recusandae animi non." |
| 8 | + ) |
| 9 | + .join("\n") + "fixes #123"; |
| 10 | + |
| 11 | +describe("parsePr", () => { |
| 12 | + bench("short body", () => { |
| 13 | + parsePr({ body: "fixes #123", title: "test", number: 124 }); |
| 14 | + }); |
| 15 | + |
| 16 | + bench("long body", () => { |
| 17 | + parsePr({ body: LONG_BODY, title: "test", number: 124 }); |
| 18 | + }); |
| 19 | + |
| 20 | + describe("nested suite", () => { |
| 21 | + bench("short body", () => { |
| 22 | + parsePr({ body: "fixes #123", title: "test", number: 124 }); |
| 23 | + }); |
| 24 | + |
| 25 | + bench("long body", () => { |
| 26 | + parsePr({ body: LONG_BODY, title: "test", number: 124 }); |
| 27 | + }); |
| 28 | + |
| 29 | + describe("deeply nested suite", () => { |
| 30 | + bench("short body", () => { |
| 31 | + parsePr({ body: "fixes #123", title: "test", number: 124 }); |
| 32 | + }); |
| 33 | + }); |
| 34 | + }); |
| 35 | +}); |
| 36 | + |
| 37 | +describe("another parsePr", () => { |
| 38 | + bench("short body", () => { |
| 39 | + parsePr({ body: "fixes #123", title: "test", number: 124 }); |
| 40 | + }); |
| 41 | + |
| 42 | + bench("long body", () => { |
| 43 | + parsePr({ body: LONG_BODY, title: "test", number: 124 }); |
| 44 | + }); |
| 45 | + |
| 46 | + describe("nested suite", () => { |
| 47 | + bench("short body", () => { |
| 48 | + parsePr({ body: "fixes #123", title: "test", number: 124 }); |
| 49 | + }); |
| 50 | + }); |
| 51 | +}); |
0 commit comments