This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env node */ | |
/* | |
BEFORE | |
mockQuery('spam-message'); | |
mockQuery('spam-message').returns({ json: spamMessageResult }); | |
AFTER | |
mockQuery('spam-message').withSomeParams({ per_page: 20 }); | |
mockQuery('spam-message').withSomeParams({ per_page: 20 }).returns({ json: spamMessageResult }); | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import People from 'twiddle/models/people'; | |
export default Controller.extend({ | |
appName: 'Ember Twiddle', | |
init() { | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
BEFORE: | |
visit('/1', async function() { | |
yep(); | |
no(); | |
}); | |
click('/2'); | |
AFTER: | |
visit('/1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env node */ | |
/* | |
BEFORE | |
Em.Test.registerAsyncHelper('asyncHelper', function(app, $element) { | |
someFunction(); | |
}); | |
Em.Test.registerSyncHelper('syncHelper', function(app, $element) { | |
someFunction(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env node */ | |
/* | |
BEFORE | |
export default Em.Model.extend({ | |
admin_id: attr(), | |
data: Em.attr(JsonType, { defaultValue: {} }), | |
admin: Em.belongsTo(Admin, { key: 'admin_id' }), | |
other: Em.hasMany(Admin, { key: 'admin_ids' }), | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env node */ | |
export default function(file, api, options) { | |
let j = api.jscodeshift; | |
let printOptions = options.printOptions || { quote: 'single' }; | |
let root = j(file.source); | |
let emberRegex = /^Em(ber)?$/; | |
let emberModule = { | |
source: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env node */ | |
/* | |
BEFORE | |
mockFindAll('email-template-data'); | |
mockFindAll('message-folder').returns({ models: makeList('message-folder', 3) }); | |
AFTER | |
mockFindAll('email-template-data').withParams({ app_id: 'tx2p130c' }); | |
mockFindAll('message-folder').withParams({ app_id: 'tx2p130c' }).returns({ models: makeList('message-folder', 3) }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env node */ | |
/* | |
BEFORE | |
assert.equal(this.countOccurrences('[data-test-something]'), 4); | |
assert.equal(this.countOccurrences('[data-test-something]'), 0); | |
assert.ok(this.countOccurrences('[data-test-something]') > 0, 'message') | |
AFTER | |
assert.dom('[data-test-something]').exists({ count: 4 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['myClass'], | |
}); |