这不起作用:
itAsync "subscribeEventedOn should receive any attached data" $ \done -> do
w <- getWindow
subscribeEventedOn "foo" (\event -> do
fprint event
expect (unwrapDetail event) `toDeepEqual` d'
itIs done
) w
emitOn sampleEvent w
expect true `toEqual` true
未知值'w'
但这确实有效:
w <- getWindow
itAsync "subscribeEventedOn should receive any attached data" $ \done -> do
subscribeEventedOn "foo" (\event -> do
fprint event
expect (unwrapDetail event) `toDeepEqual` d'
itIs done
) w
emitOn sampleEvent w
expect true `toEqual` true
为什么?这对我来说没有意义。do
(顺便说一句,我的单元测试中有嵌套块)