Skip to content

Commit 8cc050d

Browse files
fix: Pending installs should be treated as informational diagnostic
1 parent cd549f8 commit 8cc050d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Diagnostic.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ export const getPackageDiagnostic = async (
172172
packageInfo.name,
173173
versionLatest
174174
),
175-
DiagnosticSeverity.Warning,
175+
DiagnosticSeverity.Information,
176176
document,
177-
packageInfo
177+
packageInfo,
178+
DiagnosticType.READY_TO_INSTALL
178179
)
179180
}
180181

src/extension.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ jest.mock("child_process", () => ({
33
...jest.requireActual("child_process"),
44
}))
55

6+
import { DiagnosticSeverity } from "vscode"
7+
68
import { COMMAND_INSTALL, COMMAND_INSTALL_REQUEST } from "./Command"
79
import { vscodeSimulator } from "./TestUtils"
810
import { Icons } from "./Theme"
@@ -34,13 +36,17 @@ describe("package diagnostics", () => {
3436
})
3537

3638
it("valid dependency, pending installation", async () => {
37-
const { decorations, diagnostics } = await vscodeSimulator({
39+
const { actions, decorations, diagnostics } = await vscodeSimulator({
3840
packageJson: { dependencies: { "npm-outdated": "^1.0.0" } },
3941
packagesRepository: { "npm-outdated": ["1.0.0"] },
42+
selectFirsts: 1,
4043
})
4144

4245
expect(diagnostics[0]?.message).toContain("pending installation")
46+
expect(diagnostics[0]?.severity).toBe(DiagnosticSeverity.Information)
4347
expect(decorations[0]).toContain("Install pending")
48+
expect(actions[0]?.title).toBe("Install package")
49+
expect(actions).toHaveLength(1)
4450
})
4551

4652
it("valid dependency, already installed, just formalization", async () => {

0 commit comments

Comments
 (0)