Skip to content

Commit

Permalink
tests: fixed all tests performance
Browse files Browse the repository at this point in the history
  • Loading branch information
FajarKim committed Dec 2, 2023
1 parent f50768b commit 234cc15
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/randomToken.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import getRandomToken from "../src/getRandomToken";

describe("getRandomToken", () => {
describe("Test Get Random Token", () => {
it("should generate a random token without Bearer prefix by default", () => {
const token = getRandomToken(false);

Expand Down
1 change: 0 additions & 1 deletion tests/renderAPIStatsCard.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// __tests__/readmeStats.test.ts
import readmeStats from "../api/index";
import getData from "../src/getData";
import cardStyle from "../src/card";
Expand Down
20 changes: 10 additions & 10 deletions tests/renderDocsReadme.test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import fs from 'fs';
import { generateReadmeThemes } from '../scripts/generate-theme-doc';
import { generateReadmeLocales } from '../scripts/generate-translation-doc';
import fs from "fs";
import { generateReadmeThemes } from "../scripts/generate-theme-doc";
import { generateReadmeLocales } from "../scripts/generate-translation-doc";

jest.mock('fs');
jest.mock("fs");

describe('Test Generate Readme Docs', () => {
it('should generate the README content themes correctly', () => {
const username = 'FajarKim';
describe("Test Generate Readme Docs", () => {
it("should generate the README content themes correctly", () => {
const username = "FajarKim";
const generatedReadme = generateReadmeThemes(username);

expect(fs.writeFileSync).toHaveBeenCalledWith('./themes/README.md', generatedReadme);
expect(fs.writeFileSync).toHaveBeenCalledWith("./themes/README.md", generatedReadme);
});

it('should generate the README content locales correctly', () => {
it("should generate the README content locales correctly", () => {
const generatedReadme = generateReadmeLocales();

expect(fs.writeFileSync).toHaveBeenCalledWith('./docs/translations.md', generatedReadme);
expect(fs.writeFileSync).toHaveBeenCalledWith("./docs/translations.md", generatedReadme);
});
});

0 comments on commit 234cc15

Please sign in to comment.