Mailspring/spec-nylas/test_utils.coffee
Ben Gotow e198c4f6c4 fix(asar): Support ASAR, and running of specs in prod builds
Summary:
fix(task-queue): Repair the findTask function

Add "ship logs" and "open logs" to the developer menu

Patches for Chromium 42

Test Plan: Run tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1547
2015-05-21 14:41:30 -07:00

21 lines
668 B
CoffeeScript

# Utils for testing.
CSON = require 'season'
KeymapManager = require 'atom-keymap'
NylasTestUtils =
loadKeymap: (keymapPath) ->
{resourcePath} = atom.getLoadSettings()
basePath = CSON.resolve("#{resourcePath}/keymaps/base")
baseKeymaps = CSON.readFileSync(basePath)
atom.keymaps.add(basePath, baseKeymaps)
if keymapPath?
keymapPath = CSON.resolve("#{resourcePath}/#{keymapPath}")
keymapFile = CSON.readFileSync(keymapPath)
atom.keymaps.add(keymapPath, keymapFile)
keyPress: (key, target) ->
event = KeymapManager.buildKeydownEvent(key, target: target)
document.dispatchEvent(event)
module.exports = NylasTestUtils