Skip to content

Commit

Permalink
delete the check if dimJSON is undefined in removeContent
Browse files Browse the repository at this point in the history
  • Loading branch information
To-Ki-O committed Oct 26, 2022
1 parent b6b740a commit d66c72f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
3 changes: 0 additions & 3 deletions libs/accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ export class DimFileAccessor {
});
}
async removeContent(name: string) {
if (this.dimJSON === undefined) {
return;
}
const contents = this.dimJSON.contents.filter((c) => c.name !== name);
await this.writeToDimFile({
fileVersion: DIM_FILE_VERSION,
Expand Down
10 changes: 1 addition & 9 deletions tests/libs/actions.uninstall.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,7 @@ describe("UninstallAction", () => {
});
assertSpyCall(denoExitStub, 0, { args: [1] });
});

it("runs without dim.json and dim-lock.json", async () => {
await new UninstallAction().execute(undefined as void, "dummy");
assertSpyCall(consoleLogStub, 0, {
args: [Colors.red("Not found a dim.json. You should run a 'dim init'. ")],
});
assertSpyCall(denoExitStub, 0, { args: [1] });
});


it("runs with a name not recorded in dim.json or dim-lock.json and displays an error message.", async () => {
const dimData: DimJSON = {
fileVersion: "1.1",
Expand Down

0 comments on commit d66c72f

Please sign in to comment.