feat(babel6): fix es6 describe function syntax

This commit is contained in:
Evan Morikawa 2016-05-04 14:03:15 -07:00
parent e559c8f69a
commit 50f301e845
32 changed files with 32 additions and 32 deletions

View file

@ -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,

View file

@ -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()

View file

@ -4,7 +4,7 @@ import SignatureStore from '../lib/signature-store';
const TEST_SIGNATURE = '<div class="something">This is my signature.</div>';
describe("SignatureComposerExtension", () => {
describe('SignatureComposerExtension', function signatureComposerExtension() {
describe("applyTransformsToDraft", () => {
it("should unwrap the signature and remove the custom DOM element", () => {
const a = new Message({

View file

@ -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');

View file

@ -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(()=> {});

View file

@ -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 = {

View file

@ -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'));

View file

@ -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

View file

@ -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')

View file

@ -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');

View file

@ -9,7 +9,7 @@ const {
} = SystemTrayIconStore;
describe('SystemTrayIconStore', ()=> {
describe('SystemTrayIconStore', function systemTrayIconStore() {
beforeEach(()=> {
spyOn(ipcRenderer, 'send')
this.iconStore = new SystemTrayIconStore()

View file

@ -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);

View file

@ -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)

View file

@ -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'

View file

@ -18,7 +18,7 @@ const {
} = SnoozeUtils
describe('Snooze Utils', ()=> {
describe('Snooze Utils', function snoozeUtils() {
beforeEach(()=> {
this.name = 'Snoozed Folder'
this.accId = 123

View file

@ -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')

View file

@ -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');

View file

@ -10,7 +10,7 @@ const reactStub = (displayName)=> {
};
describe('InjectedComponentSet', ()=> {
describe('InjectedComponentSet', function injectedComponentSet() {
describe('render', ()=> {
beforeEach(()=> {
const components = [reactStub('comp1'), reactStub('comp2')];

View file

@ -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() {
});

View file

@ -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")

View file

@ -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');

View file

@ -5,7 +5,7 @@ import {
NylasSyncStatusStore,
} from 'nylas-exports';
describe('CategoryStore', ()=> {
describe('CategoryStore', function categoryStore() {
beforeEach(()=> {
spyOn(AccountStore, 'accountForId').andReturn({categoryCollection: ()=> 'labels'})
});

View file

@ -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));

View file

@ -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'});

View file

@ -2,7 +2,7 @@ import {NylasSyncStatusStore} from 'nylas-exports'
const store = NylasSyncStatusStore
describe('NylasSyncStatusStore', ()=> {
describe('NylasSyncStatusStore', function nylasSyncStatusStore() {
beforeEach(()=> {
store._statesByAccount = {}
});

View file

@ -9,7 +9,7 @@ import {
} from 'nylas-exports'
describe('TaskFactory', ()=> {
describe('TaskFactory', function taskFactory() {
beforeEach(()=> {
this.categories = {
'ac-1': {

View file

@ -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 {

View file

@ -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"

View file

@ -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');

View file

@ -10,7 +10,7 @@ import {
const DBt = DatabaseTransaction.prototype;
describe("SyncbackDraftFilesTask", () => {
describe('SyncbackDraftFilesTask', function syncbackDraftFilesTask() {
describe("with uploads", () => {
beforeEach(() => {
this.uploads = [

View file

@ -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})

View file

@ -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")