Skip to content

Commit d77bd05

Browse files
Copilotjwulf
andcommitted
fix: properly reset console spy array in completion tests
Use array.length = 0 instead of reassignment to maintain spy reference Co-authored-by: jwulf <406975+jwulf@users.noreply.github.com>
1 parent bca3688 commit d77bd05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/unit/completion.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ describe('Completion Module', () => {
146146
const output = consoleLogSpy.join('\n');
147147
assert.ok(output.includes('# c8ctl bash completion'));
148148

149-
consoleLogSpy = [];
149+
consoleLogSpy.length = 0;
150150
showCompletion('Zsh');
151151

152152
const output2 = consoleLogSpy.join('\n');
153153
assert.ok(output2.includes('#compdef c8ctl c8'));
154154

155-
consoleLogSpy = [];
155+
consoleLogSpy.length = 0;
156156
showCompletion('FiSh');
157157

158158
const output3 = consoleLogSpy.join('\n');

0 commit comments

Comments
 (0)