Skip to content

Commit 17d2b0c

Browse files
committed
Stub the socket.sleep() function for the SleepWatcher tests
1 parent a165c5f commit 17d2b0c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/cmd_spec.moon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,15 @@ describe "watcher", ->
259259

260260
describe "polling watcher", ->
261261
before_each ->
262+
-- Stub sleep(); it's not actually called during the testing but needs to
263+
-- be there for the import in SleepWatcher.new()
264+
package.loaded.socket =
265+
sleep: () -> nil
262266
test_watcher = watchers.SleepWatcher output_to, input_paths, prefix_map
263267

268+
after_each ->
269+
package.loaded.socket = nil
270+
264271
describe "process_file_time", ->
265272
local test_process
266273
before_each ->

0 commit comments

Comments
 (0)