tests: use custom benchmarking solution instead of outdated jest-bench package (#4468)
* Remove jest-bench dependency and use custom solutions * review * Update tests/bench/calculateRank.bench.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Alexandr <qwerty541zxc@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
8 files changed
+157
-303
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { benchmarkSuite } from "jest-bench";
|
||||
import api from "../../api/index.js";
|
||||
import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import { jest } from "@jest/globals";
|
||||
import { it, jest } from "@jest/globals";
|
||||
import { runAndLogStats } from "./utils.js";
|
||||
|
||||
const stats = {
|
||||
name: "Anurag Hazra",
|
||||
@@ -69,10 +69,10 @@ const faker = (query, data) => {
|
||||
return { req, res };
|
||||
};
|
||||
|
||||
benchmarkSuite("test /api", {
|
||||
["simple request"]: async () => {
|
||||
it("test /api", async () => {
|
||||
await runAndLogStats("test /api", async () => {
|
||||
const { req, res } = faker({}, data_stats);
|
||||
|
||||
await api(req, res);
|
||||
},
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user