From 50f301e8452167cf0eed05ce897a7b282195c0ee Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Wed, 4 May 2016 14:03:15 -0700 Subject: [PATCH] feat(babel6): fix es6 describe function syntax --- .../composer-emoji/spec/emoji-button-popover-spec.jsx | 2 +- .../composer-emoji/spec/emoji-composer-extension-spec.jsx | 2 +- .../spec/signature-composer-extension-spec.es6 | 2 +- .../spec/spellcheck-composer-extension-spec.es6 | 2 +- .../composer-templates/spec/template-store-spec.es6 | 2 +- internal_packages/composer/spec/composer-header-spec.jsx | 2 +- .../spec/autoload-images-extension-spec.es6 | 2 +- internal_packages/message-list/spec/autolinker-spec.es6 | 2 +- .../preferences/spec/preferences-account-details-spec.jsx | 2 +- .../spec/tracking-pixels-extension-spec.es6 | 2 +- .../system-tray/spec/system-tray-icon-store-spec.es6 | 2 +- internal_packages/theme-picker/spec/theme-picker-spec.jsx | 2 +- .../thread-list/spec/category-removal-target-rulesets-spec.es6 | 2 +- internal_packages/thread-snooze/spec/snooze-store-spec.es6 | 2 +- internal_packages/thread-snooze/spec/snooze-utils-spec.es6 | 2 +- spec/components/date-input-spec.jsx | 2 +- spec/components/editable-list-spec.jsx | 2 +- spec/components/injected-component-set-spec.jsx | 2 +- spec/components/nylas-calendar/week-view-extended-spec.jsx | 2 +- spec/date-utils-spec.es6 | 2 +- spec/extensions/composer-extension-adapter-spec.es6 | 2 +- spec/stores/category-store-spec.es6 | 2 +- spec/stores/draft-factory-spec.es6 | 2 +- spec/stores/draft-store-spec.es6 | 2 +- spec/stores/nylas-sync-status-store-spec.es6 | 2 +- spec/task-factory-spec.es6 | 2 +- spec/tasks/base-draft-task-spec.es6 | 2 +- spec/tasks/destroy-model-task-spec.es6 | 2 +- spec/tasks/send-draft-task-spec.es6 | 2 +- spec/tasks/syncback-draft-files-task-spec.es6 | 2 +- spec/tasks/syncback-draft-task-spec.es6 | 2 +- spec/tasks/syncback-model-task-spec.es6 | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/internal_packages/composer-emoji/spec/emoji-button-popover-spec.jsx b/internal_packages/composer-emoji/spec/emoji-button-popover-spec.jsx index f60790bfc..5952d174e 100644 --- a/internal_packages/composer-emoji/spec/emoji-button-popover-spec.jsx +++ b/internal_packages/composer-emoji/spec/emoji-button-popover-spec.jsx @@ -7,7 +7,7 @@ import Contenteditable from '../../../src/components/contenteditable/contentedit import EmojiButtonPopover from '../lib/emoji-button-popover'; import EmojiComposerExtension from '../lib/emoji-composer-extension'; -describe('EmojiButtonPopover', ()=> { +describe('EmojiButtonPopover', function emojiButtonPopover() { beforeEach(()=> { this.position = { x: 20, diff --git a/internal_packages/composer-emoji/spec/emoji-composer-extension-spec.jsx b/internal_packages/composer-emoji/spec/emoji-composer-extension-spec.jsx index 53dfc92da..0340b2d4e 100644 --- a/internal_packages/composer-emoji/spec/emoji-composer-extension-spec.jsx +++ b/internal_packages/composer-emoji/spec/emoji-composer-extension-spec.jsx @@ -6,7 +6,7 @@ import {renderIntoDocument} from '../../../spec/nylas-test-utils'; import Contenteditable from '../../../src/components/contenteditable/contenteditable'; import EmojiComposerExtension from '../lib/emoji-composer-extension'; -describe('EmojiComposerExtension', ()=> { +describe('EmojiComposerExtension', function emojiComposerExtension() { beforeEach(()=> { spyOn(EmojiComposerExtension, 'onContentChanged').andCallThrough() spyOn(EmojiComposerExtension, '_onSelectEmoji').andCallThrough() diff --git a/internal_packages/composer-signature/spec/signature-composer-extension-spec.es6 b/internal_packages/composer-signature/spec/signature-composer-extension-spec.es6 index 7094e4324..2386b050e 100644 --- a/internal_packages/composer-signature/spec/signature-composer-extension-spec.es6 +++ b/internal_packages/composer-signature/spec/signature-composer-extension-spec.es6 @@ -4,7 +4,7 @@ import SignatureStore from '../lib/signature-store'; const TEST_SIGNATURE = '
This is my signature.
'; -describe("SignatureComposerExtension", () => { +describe('SignatureComposerExtension', function signatureComposerExtension() { describe("applyTransformsToDraft", () => { it("should unwrap the signature and remove the custom DOM element", () => { const a = new Message({ diff --git a/internal_packages/composer-spellcheck/spec/spellcheck-composer-extension-spec.es6 b/internal_packages/composer-spellcheck/spec/spellcheck-composer-extension-spec.es6 index 7344edc7a..79041afcb 100644 --- a/internal_packages/composer-spellcheck/spec/spellcheck-composer-extension-spec.es6 +++ b/internal_packages/composer-spellcheck/spec/spellcheck-composer-extension-spec.es6 @@ -11,7 +11,7 @@ const initialHTML = fs.readFileSync(initialPath).toString(); const expectedPath = path.join(__dirname, 'fixtures', 'california-with-misspellings-after.html'); const expectedHTML = fs.readFileSync(expectedPath).toString(); -describe("SpellcheckComposerExtension", () => { +describe('SpellcheckComposerExtension', function spellcheckComposerExtension() { beforeEach(() => { // Avoid differences between node-spellcheck on different platforms const lookupPath = path.join(__dirname, 'fixtures', 'california-spelling-lookup.json'); diff --git a/internal_packages/composer-templates/spec/template-store-spec.es6 b/internal_packages/composer-templates/spec/template-store-spec.es6 index 7c9f06848..fb16f8c90 100644 --- a/internal_packages/composer-templates/spec/template-store-spec.es6 +++ b/internal_packages/composer-templates/spec/template-store-spec.es6 @@ -17,7 +17,7 @@ const stubTemplates = [ {id: 'template2.html', name: 'template2', path: `${stubTemplatesDir}/template2.html`}, ]; -describe('TemplateStore', ()=> { +describe('TemplateStore', function templateStore() { beforeEach(()=> { spyOn(fs, 'mkdir'); spyOn(shell, 'showItemInFolder').andCallFake(()=> {}); diff --git a/internal_packages/composer/spec/composer-header-spec.jsx b/internal_packages/composer/spec/composer-header-spec.jsx index ebc5f31b1..00d53233a 100644 --- a/internal_packages/composer/spec/composer-header-spec.jsx +++ b/internal_packages/composer/spec/composer-header-spec.jsx @@ -6,7 +6,7 @@ import {Contact, Message} from 'nylas-exports'; import ComposerHeader from '../lib/composer-header'; import Fields from '../lib/fields'; -describe("ComposerHeader", () => { +describe('ComposerHeader', function composerHeader() { beforeEach(() => { this.createWithDraft = (draft) => { const session = { diff --git a/internal_packages/message-autoload-images/spec/autoload-images-extension-spec.es6 b/internal_packages/message-autoload-images/spec/autoload-images-extension-spec.es6 index d44bdfcee..64620fe41 100644 --- a/internal_packages/message-autoload-images/spec/autoload-images-extension-spec.es6 +++ b/internal_packages/message-autoload-images/spec/autoload-images-extension-spec.es6 @@ -3,7 +3,7 @@ import path from 'path'; import AutoloadImagesExtension from '../lib/autoload-images-extension'; import AutoloadImagesStore from '../lib/autoload-images-store'; -describe("AutoloadImagesExtension", () => { +describe('AutoloadImagesExtension', function autoloadImagesExtension() { describe("formatMessageBody", () => { const scenarios = []; const fixtures = path.resolve(path.join(__dirname, 'fixtures')); diff --git a/internal_packages/message-list/spec/autolinker-spec.es6 b/internal_packages/message-list/spec/autolinker-spec.es6 index e99ea155c..820f2bb67 100644 --- a/internal_packages/message-list/spec/autolinker-spec.es6 +++ b/internal_packages/message-list/spec/autolinker-spec.es6 @@ -2,7 +2,7 @@ import {autolink} from '../lib/autolinker'; import fs from 'fs'; import path from 'path'; -describe("autolink", () => { +describe('autolink', function autolink() { const fixturesDir = path.join(__dirname, 'autolinker-fixtures'); fs.readdirSync(fixturesDir).filter(filename => filename.indexOf('-in.html') !== -1 diff --git a/internal_packages/preferences/spec/preferences-account-details-spec.jsx b/internal_packages/preferences/spec/preferences-account-details-spec.jsx index f3745b568..0e8dc9d89 100644 --- a/internal_packages/preferences/spec/preferences-account-details-spec.jsx +++ b/internal_packages/preferences/spec/preferences-account-details-spec.jsx @@ -18,7 +18,7 @@ const account = new Account({ defaultAlias: null, }) -describe('PreferencesAccountDetails', ()=> { +describe('PreferencesAccountDetails', function preferencesAccountDetails() { beforeEach(()=> { this.account = account this.onAccountUpdated = jasmine.createSpy('onAccountUpdated') diff --git a/internal_packages/remove-tracking-pixels/spec/tracking-pixels-extension-spec.es6 b/internal_packages/remove-tracking-pixels/spec/tracking-pixels-extension-spec.es6 index 8b60cfb1b..a8f00705c 100644 --- a/internal_packages/remove-tracking-pixels/spec/tracking-pixels-extension-spec.es6 +++ b/internal_packages/remove-tracking-pixels/spec/tracking-pixels-extension-spec.es6 @@ -6,7 +6,7 @@ const readFixture = (name) => { return fs.readFileSync(`${__dirname}/fixtures/${name}`).toString().trim() } -describe("TrackingPixelsExtension", () => { +describe("TrackingPixelsExtension", function trackingPixelsExtension() { it("should splice all tracking pixels from emails I've sent", () => { const before = readFixture('a-before.txt'); const expected = readFixture('a-after.txt'); diff --git a/internal_packages/system-tray/spec/system-tray-icon-store-spec.es6 b/internal_packages/system-tray/spec/system-tray-icon-store-spec.es6 index 84322412f..62ea98f69 100644 --- a/internal_packages/system-tray/spec/system-tray-icon-store-spec.es6 +++ b/internal_packages/system-tray/spec/system-tray-icon-store-spec.es6 @@ -9,7 +9,7 @@ const { } = SystemTrayIconStore; -describe('SystemTrayIconStore', ()=> { +describe('SystemTrayIconStore', function systemTrayIconStore() { beforeEach(()=> { spyOn(ipcRenderer, 'send') this.iconStore = new SystemTrayIconStore() diff --git a/internal_packages/theme-picker/spec/theme-picker-spec.jsx b/internal_packages/theme-picker/spec/theme-picker-spec.jsx index 65ea4a529..938b2892f 100644 --- a/internal_packages/theme-picker/spec/theme-picker-spec.jsx +++ b/internal_packages/theme-picker/spec/theme-picker-spec.jsx @@ -9,7 +9,7 @@ const {resourcePath} = NylasEnv.getLoadSettings(); const light = new ThemePackage(resourcePath + '/internal_packages/ui-light'); const dark = new ThemePackage(resourcePath + '/internal_packages/ui-dark'); -describe('ThemePicker', ()=> { +describe('ThemePicker', function themePicker() { beforeEach(()=> { spyOn(NylasEnv.themes, 'getLoadedThemes').andReturn([light, dark]); spyOn(NylasEnv.themes, 'getActiveTheme').andReturn(light); diff --git a/internal_packages/thread-list/spec/category-removal-target-rulesets-spec.es6 b/internal_packages/thread-list/spec/category-removal-target-rulesets-spec.es6 index 5bfc59db2..19712ccdc 100644 --- a/internal_packages/thread-list/spec/category-removal-target-rulesets-spec.es6 +++ b/internal_packages/thread-list/spec/category-removal-target-rulesets-spec.es6 @@ -2,7 +2,7 @@ import {AccountStore, CategoryStore} from 'nylas-exports' import CategoryRemovalTargetRulesets from '../lib/category-removal-target-rulesets' const {Gmail} = CategoryRemovalTargetRulesets; -describe('CategoryRemovalTargetRulesets', ()=> { +describe('CategoryRemovalTargetRulesets', function categoryRemovalTargetRulesets() { describe('Gmail', ()=> { it('is a no op in archive, all, spam and sent', ()=> { expect(Gmail.all).toBe(null) diff --git a/internal_packages/thread-snooze/spec/snooze-store-spec.es6 b/internal_packages/thread-snooze/spec/snooze-store-spec.es6 index 395f7a0c7..31347dc50 100644 --- a/internal_packages/thread-snooze/spec/snooze-store-spec.es6 +++ b/internal_packages/thread-snooze/spec/snooze-store-spec.es6 @@ -10,7 +10,7 @@ import SnoozeUtils from '../lib/snooze-utils' import SnoozeStore from '../lib/snooze-store' -describe('SnoozeStore', ()=> { +describe('SnoozeStore', function snoozeStore() { beforeEach(()=> { this.store = new SnoozeStore('plug-id', 'plug-name') this.name = 'Snooze folder' diff --git a/internal_packages/thread-snooze/spec/snooze-utils-spec.es6 b/internal_packages/thread-snooze/spec/snooze-utils-spec.es6 index 4832b40ba..c071203f7 100644 --- a/internal_packages/thread-snooze/spec/snooze-utils-spec.es6 +++ b/internal_packages/thread-snooze/spec/snooze-utils-spec.es6 @@ -18,7 +18,7 @@ const { } = SnoozeUtils -describe('Snooze Utils', ()=> { +describe('Snooze Utils', function snoozeUtils() { beforeEach(()=> { this.name = 'Snoozed Folder' this.accId = 123 diff --git a/spec/components/date-input-spec.jsx b/spec/components/date-input-spec.jsx index 22b5ffe71..07cf94762 100644 --- a/spec/components/date-input-spec.jsx +++ b/spec/components/date-input-spec.jsx @@ -19,7 +19,7 @@ const makeInput = (props = {})=> { return input }; -describe('DateInput', ()=> { +describe('DateInput', function dateInput() { describe('onInputKeyDown', ()=> { it('should submit the input if Enter or Escape pressed', ()=> { const onSubmitDate = jasmine.createSpy('onSubmitDate') diff --git a/spec/components/editable-list-spec.jsx b/spec/components/editable-list-spec.jsx index 0319f57f8..0578b25f8 100644 --- a/spec/components/editable-list-spec.jsx +++ b/spec/components/editable-list-spec.jsx @@ -19,7 +19,7 @@ const makeList = (items = [], props = {})=> { return list }; -describe('EditableList', ()=> { +describe('EditableList', function editableList() { describe('_onItemClick', ()=> { it('calls onSelectItem', ()=> { const onSelectItem = jasmine.createSpy('onSelectItem'); diff --git a/spec/components/injected-component-set-spec.jsx b/spec/components/injected-component-set-spec.jsx index 8309338ca..f75844ba4 100644 --- a/spec/components/injected-component-set-spec.jsx +++ b/spec/components/injected-component-set-spec.jsx @@ -10,7 +10,7 @@ const reactStub = (displayName)=> { }; -describe('InjectedComponentSet', ()=> { +describe('InjectedComponentSet', function injectedComponentSet() { describe('render', ()=> { beforeEach(()=> { const components = [reactStub('comp1'), reactStub('comp2')]; diff --git a/spec/components/nylas-calendar/week-view-extended-spec.jsx b/spec/components/nylas-calendar/week-view-extended-spec.jsx index 54d6e466e..86ae04039 100644 --- a/spec/components/nylas-calendar/week-view-extended-spec.jsx +++ b/spec/components/nylas-calendar/week-view-extended-spec.jsx @@ -1,5 +1,5 @@ import {events} from './fixtures/events' import {NylasCalendar} from 'nylas-component-kit' -describe("Extended Nylas Calendar Week View", () => { +describe('Extended Nylas Calendar Week View', function extendedNylasCalendarWeekView() { }); diff --git a/spec/date-utils-spec.es6 b/spec/date-utils-spec.es6 index 95a34e0e4..86fb7ee67 100644 --- a/spec/date-utils-spec.es6 +++ b/spec/date-utils-spec.es6 @@ -2,7 +2,7 @@ import moment from 'moment' import {DateUtils} from 'nylas-exports' -describe('DateUtils', ()=> { +describe('DateUtils', function dateUtils() { describe('nextWeek', ()=> { it('returns tomorrow if now is sunday', ()=> { const sunday = moment("03-06-2016", "MM-DD-YYYY") diff --git a/spec/extensions/composer-extension-adapter-spec.es6 b/spec/extensions/composer-extension-adapter-spec.es6 index 147d62669..3021cc1f5 100644 --- a/spec/extensions/composer-extension-adapter-spec.es6 +++ b/spec/extensions/composer-extension-adapter-spec.es6 @@ -12,7 +12,7 @@ const editor = { }, }; -describe('ComposerExtensionAdapter', ()=> { +describe('ComposerExtensionAdapter', function composerExtensionAdapter() { describe('adaptOnInput', ()=> { it('adapts correctly if onContentChanged already defined', ()=> { const onInputSpy = jasmine.createSpy('onInput'); diff --git a/spec/stores/category-store-spec.es6 b/spec/stores/category-store-spec.es6 index a51d5e22a..65592ba27 100644 --- a/spec/stores/category-store-spec.es6 +++ b/spec/stores/category-store-spec.es6 @@ -5,7 +5,7 @@ import { NylasSyncStatusStore, } from 'nylas-exports'; -describe('CategoryStore', ()=> { +describe('CategoryStore', function categoryStore() { beforeEach(()=> { spyOn(AccountStore, 'accountForId').andReturn({categoryCollection: ()=> 'labels'}) }); diff --git a/spec/stores/draft-factory-spec.es6 b/spec/stores/draft-factory-spec.es6 index 176dca769..20c15a806 100644 --- a/spec/stores/draft-factory-spec.es6 +++ b/spec/stores/draft-factory-spec.es6 @@ -25,7 +25,7 @@ let fakeMessageWithFiles = null; let msgWithReplyToDuplicates = null; let account = null; -describe("DraftFactory", () => { +describe('DraftFactory', function draftFactory() { beforeEach(() => { // Out of the scope of these specs spyOn(InlineStyleTransformer, 'run').andCallFake((input) => Promise.resolve(input)); diff --git a/spec/stores/draft-store-spec.es6 b/spec/stores/draft-store-spec.es6 index e1fd13a68..89aef9e01 100644 --- a/spec/stores/draft-store-spec.es6 +++ b/spec/stores/draft-store-spec.es6 @@ -24,7 +24,7 @@ class TestExtension extends ComposerExtension { } } -describe("DraftStore", () => { +describe('DraftStore', function draftStore() { beforeEach(() => { this.fakeThread = new Thread({id: 'fake-thread', clientId: 'fake-thread'}); this.fakeMessage = new Message({id: 'fake-message', clientId: 'fake-message'}); diff --git a/spec/stores/nylas-sync-status-store-spec.es6 b/spec/stores/nylas-sync-status-store-spec.es6 index 03f4e295b..b51ee8512 100644 --- a/spec/stores/nylas-sync-status-store-spec.es6 +++ b/spec/stores/nylas-sync-status-store-spec.es6 @@ -2,7 +2,7 @@ import {NylasSyncStatusStore} from 'nylas-exports' const store = NylasSyncStatusStore -describe('NylasSyncStatusStore', ()=> { +describe('NylasSyncStatusStore', function nylasSyncStatusStore() { beforeEach(()=> { store._statesByAccount = {} }); diff --git a/spec/task-factory-spec.es6 b/spec/task-factory-spec.es6 index 7e73df5d4..58e85a21e 100644 --- a/spec/task-factory-spec.es6 +++ b/spec/task-factory-spec.es6 @@ -9,7 +9,7 @@ import { } from 'nylas-exports' -describe('TaskFactory', ()=> { +describe('TaskFactory', function taskFactory() { beforeEach(()=> { this.categories = { 'ac-1': { diff --git a/spec/tasks/base-draft-task-spec.es6 b/spec/tasks/base-draft-task-spec.es6 index 2a94748ce..c997db8e5 100644 --- a/spec/tasks/base-draft-task-spec.es6 +++ b/spec/tasks/base-draft-task-spec.es6 @@ -5,7 +5,7 @@ import { import BaseDraftTask from '../../src/flux/tasks/base-draft-task'; -describe("BaseDraftTask", () => { +describe('BaseDraftTask', function baseDraftTask() { describe("shouldDequeueOtherTask", () => { it("should dequeue instances of the same subclass for the same draft which are older", () => { class ATask extends BaseDraftTask { diff --git a/spec/tasks/destroy-model-task-spec.es6 b/spec/tasks/destroy-model-task-spec.es6 index 733490aa4..49d5bda55 100644 --- a/spec/tasks/destroy-model-task-spec.es6 +++ b/spec/tasks/destroy-model-task-spec.es6 @@ -6,7 +6,7 @@ import { DestroyModelTask, DatabaseTransaction} from 'nylas-exports' -describe("DestroyModelTask", () => { +describe('DestroyModelTask', function destroyModelTask() { beforeEach(() => { this.existingModel = new Model() this.existingModel.clientId = "local-123" diff --git a/spec/tasks/send-draft-task-spec.es6 b/spec/tasks/send-draft-task-spec.es6 index 644ce380c..d55e3bd65 100644 --- a/spec/tasks/send-draft-task-spec.es6 +++ b/spec/tasks/send-draft-task-spec.es6 @@ -17,7 +17,7 @@ import NotifyPluginsOfSendTask from '../../src/flux/tasks/notify-plugins-of-send const DBt = DatabaseTransaction.prototype; const withoutWhitespace = (s) => s.replace(/[\n\r\s]/g, ''); -describe("SendDraftTask", () => { +describe('SendDraftTask', function sendDraftTask() { describe("assertDraftValidity", () => { it("rejects if there are still uploads on the draft", () => { const badTask = new SendDraftTask('1'); diff --git a/spec/tasks/syncback-draft-files-task-spec.es6 b/spec/tasks/syncback-draft-files-task-spec.es6 index e92e0e51d..7206887c9 100644 --- a/spec/tasks/syncback-draft-files-task-spec.es6 +++ b/spec/tasks/syncback-draft-files-task-spec.es6 @@ -10,7 +10,7 @@ import { const DBt = DatabaseTransaction.prototype; -describe("SyncbackDraftFilesTask", () => { +describe('SyncbackDraftFilesTask', function syncbackDraftFilesTask() { describe("with uploads", () => { beforeEach(() => { this.uploads = [ diff --git a/spec/tasks/syncback-draft-task-spec.es6 b/spec/tasks/syncback-draft-task-spec.es6 index f3559dd3b..f5435d689 100644 --- a/spec/tasks/syncback-draft-task-spec.es6 +++ b/spec/tasks/syncback-draft-task-spec.es6 @@ -41,7 +41,7 @@ const remoteDraft = () => new Message(_.extend({}, testData, { version: 2, })); -describe("SyncbackDraftTask", () => { +describe('SyncbackDraftTask', function syncbackDraftTask() { beforeEach(() => { spyOn(AccountStore, "accountForEmail").andCallFake((email) => new Account({clientId: 'local-abc123', serverId: 'abc123', emailAddress: email}) diff --git a/spec/tasks/syncback-model-task-spec.es6 b/spec/tasks/syncback-model-task-spec.es6 index d7165840b..0ca86c579 100644 --- a/spec/tasks/syncback-model-task-spec.es6 +++ b/spec/tasks/syncback-model-task-spec.es6 @@ -13,7 +13,7 @@ class TestTask extends SyncbackModelTask { } } -describe("SyncbackModelTask", () => { +describe('SyncbackModelTask', function syncbackModelTask() { beforeEach(() => { this.testModel = new Model({accountId: 'account-123'}) spyOn(DatabaseTransaction.prototype, "persistModel")