Skip to content

Commit

Permalink
Ensure tests clean up temporary directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jun 13, 2024
1 parent 53058ae commit fae4e0e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/lib/converter/utils/repository.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { spawnSync } from "child_process";
import type { Logger } from "../../utils";
import { BasePath } from "../utils/base-path";
import { Bench } from "../../utils/perf";
import { NonEnumerable } from "../../utils/general";
import { dirname } from "path";
import { insertSorted } from "../../utils/array";
Expand Down Expand Up @@ -120,7 +119,6 @@ export class GitRepository implements Repository {
* @param path The potential repository root.
* @returns A new instance of {@link GitRepository} or undefined.
*/
@Bench
static tryCreateRepository(
path: string,
sourceLinkTemplate: string,
Expand Down Expand Up @@ -199,7 +197,6 @@ export class RepositoryManager {
* @param fileName The name of the file a repository should be looked for.
* @returns The found repository info or undefined.
*/
@Bench
getRepository(fileName: string): Repository | undefined {
if (this.disableGit) {
return new AssumedRepository(
Expand Down
3 changes: 1 addition & 2 deletions src/test/utils/options/readers/package-json.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ describe("Options - PackageJsonReader", () => {
const proj = project(testTitle.replace(/[ "]/g, "_"));
proj.addFile("package.json", pkgJsonContent);
proj.write();
after(() => proj.rm());

await optsContainer.read(testLogger, proj.cwd);

proj.rm();

test(testLogger);
testLogger.expectNoOtherMessages();
});
Expand Down
1 change: 1 addition & 0 deletions src/test/utils/options/readers/tsconfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe("Options - TSConfigReader", () => {
function testError(name: string, file: object) {
it(name, async () => {
const project = tempdirProject();
after(() => project.rm());
project.addJsonFile("tsconfig.json", file);
await readWithProject(project, true, false);
equal(logger.hasErrors(), true, "No error was logged");
Expand Down
3 changes: 2 additions & 1 deletion src/test/utils/options/readers/typedoc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ describe("Options - TypeDocReader", () => {

it("Supports comments in json", async () => {
const project = fsProject("jsonc");
after(() => project.rm());

project.addFile("typedoc.json", '//comment\n{"name": "comment"}');
const logger = new TestLogger();

project.write();
options.reset();
options.setValue("options", project.cwd);
await options.read(logger);
project.rm();

logger.expectNoOtherMessages();
equal(options.getValue("name"), "comment");
Expand Down

0 comments on commit fae4e0e

Please sign in to comment.