Skip to content

Commit 2a64cdb

Browse files
committed
Fix counting bug
1 parent 890966a commit 2a64cdb

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

lisp/core/analyze.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Argument LEVEL and MSG are data from the debug log signal."
109109
(dolist (file files)
110110
(eask--silent-error
111111
(eask--save-load-eask-file file
112+
(push file checked-files)
112113
(push file checked-files))))
113114

114115
;; Print result

test/jest/analyze.test.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,10 @@ describe("analyze", () => {
7676

7777
it("handles json", async () => {
7878
await expect(ctx.runEask("analyze --json")).rejects.toThrow();
79-
await expect(ctx.runEask("analyze Eask --json")).rejects.toThrow(
80-
expect.objectContaining({
81-
code: 1,
82-
stderr: expect.stringContaining("(Checked 1 file)"),
83-
}),
84-
);
79+
await expect(ctx.runEask("analyze Eask --json")).rejects.toMatchObject({
80+
code: 1,
81+
stderr: expect.stringContaining("(Checked 1 file)"),
82+
});
8583
});
8684
});
8785

@@ -128,19 +126,19 @@ describe("analyze", () => {
128126
).rejects.toThrow();
129127
});
130128

131-
// TODO prints 0 for some reason
132-
it.failing("should print Checked when there are errors", async () => {
129+
it("should print Checked when there are errors", async () => {
133130
await expect(ctx.runEask("analyze Eask-error")).rejects.toMatchObject({
134-
stderr: "(Checked 1 file)",
131+
stderr: expect.stringContaining("(Checked 1 file)"),
135132
});
136133
});
137134

138-
// TODO prints 1 for some reason
139-
it.failing("should check all files when --allow-error is set", async () => {
135+
it("should check all files when --allow-error is set", async () => {
140136
// this is not a great test because when there is any error it doesn't print this note
141137
await expect(
142138
ctx.runEask("analyze --allow-error Eask-normal Eask-error"),
143-
).rejects.toMatchObject({ stderr: "(Checked 2 files)" });
139+
).rejects.toMatchObject({
140+
stderr: expect.stringContaining("(Checked 2 files)"),
141+
});
144142
});
145143

146144
// although the output does match, it still doesn't exit with an error

0 commit comments

Comments
 (0)