I think this logic depends on the context menu being displayed at 0,0 of page and context menu item being at 20,20. I agree with @JeffryBooher that it's fragile and unnecessary to test this. Instead you can use `closeOthers = require("main")` to include your module and call the `handleClose()` function directly. Note: you'll need to export it as something like `_handleClose` to indicate it's only meant to be public for unit testing.

Related comment: I notice that this extension only displays the "Close Others" command in the context menu when there's more than 1 item in the Working Set. I prefer to always have commands shown and then disable them appropriately. I mention this, because this test depends on context menu item being in a particular position, yet this extension makes this indeterminate for other code.