keymap-extensions-spec.js 736 B

1234567891011121314151617181920212223
  1. const temp = require('temp').track();
  2. const fs = require('fs-plus');
  3. describe('keymap-extensions', function() {
  4. beforeEach(function() {
  5. atom.keymaps.configDirPath = temp.path('atom-spec-keymap-ext');
  6. fs.writeFileSync(atom.keymaps.getUserKeymapPath(), '#');
  7. this.userKeymapLoaded = function() {};
  8. atom.keymaps.onDidLoadUserKeymap(() => this.userKeymapLoaded());
  9. });
  10. afterEach(function() {
  11. fs.removeSync(atom.keymaps.configDirPath);
  12. atom.keymaps.destroy();
  13. });
  14. describe('did-load-user-keymap', () =>
  15. it('fires when user keymap is loaded', function() {
  16. spyOn(this, 'userKeymapLoaded');
  17. atom.keymaps.loadUserKeymap();
  18. expect(this.userKeymapLoaded).toHaveBeenCalled();
  19. }));
  20. });