From 3eafc22955162800c9e546ec1b1e548652a52c80 Mon Sep 17 00:00:00 2001 From: Lorcan Coyle Date: Mon, 12 Dec 2016 11:37:26 +0000 Subject: [PATCH] Misc. typo fixes --- README.md | 10 +++++----- addon/builder/fixture-builder.js | 6 +++--- addon/converter/fixture-converter.js | 8 ++++---- addon/converter/jsonapi-fixture-converter.js | 2 +- addon/converter/rest-fixture-converter.js | 2 +- addon/mocks/exposed-request-functions.js | 4 ++-- addon/mocks/mock-create-request.js | 2 +- addon/mocks/mock-get-request.js | 2 +- addon/model-definition.js | 6 +++--- addon/utils/manual-setup.js | 2 +- tests/dummy/app/tests/factories/cat.js | 4 ++-- tests/helpers/utility-methods.js | 2 +- tests/unit/drf-adapter-test.js | 2 +- tests/unit/factory-guy-test.js | 4 ++-- tests/unit/models/profile-test.js | 2 +- tests/unit/models/user-test.js | 2 +- tests/unit/shared-factory-guy-test-helper-tests.js | 10 +++++----- tests/unit/utils/helper-functions-test.js | 2 +- 18 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 6963e56e..a612af8e 100644 --- a/README.md +++ b/README.md @@ -1663,7 +1663,7 @@ Usage: profile.save() //=> will fail ```` -*mocking a failed update and retry with succees* +*mocking a failed update and retry with success* ```javascript let profile = make('profile'); @@ -1689,7 +1689,7 @@ Usage: ##### mockDelete - Need to wrap tests using mockDelete with: Ember.run(function() { 'your test' }) - - To handle deleteing a model + - To handle deleting a model - Pass in a record ( or a typeName and id ) Usage: @@ -1739,8 +1739,8 @@ Usage: ##### Tips and Tricks ###### Tip 1: Fun with makeList/buildList and traits - - This is probably the funnest thing in FactoryGuy, if your not using this - syntax yet, you are truely missing out. + - This is probably the funnest thing in FactoryGuy, if you're not using this + syntax yet, you are truly missing out. ```javascript @@ -1765,7 +1765,7 @@ Usage: // app/serializers/person.js export default DS.RESTSerializer.extend({ - // let's say your modifying all names to be Japanese honorific style + // let's say you're modifying all names to be Japanese honorific style serialize: function(snapshot, options) { var json = this._super(snapshot, options); diff --git a/addon/builder/fixture-builder.js b/addon/builder/fixture-builder.js index 7b4d6be5..1e0e329f 100644 --- a/addon/builder/fixture-builder.js +++ b/addon/builder/fixture-builder.js @@ -92,15 +92,15 @@ export default class { @returns {{}} JSONAPI formatted errors */ convertResponseErrors(object) { - let jsonAPIErrrors = []; + let jsonAPIErrors = []; Ember.assert('[ember-data-factory-guy] Your error response must have an errors key. The errors hash format is: {errors: {name: ["name too short"]}}', object.errors); let errors = object.errors; for (let key in errors) { let description = Ember.typeOf(errors[key]) === "array" ? errors[key][0] : errors[key]; let source = { pointer: "data/attributes/" + key }; let newError = { detail: description, title: "invalid " + key, source: source }; - jsonAPIErrrors.push(newError); + jsonAPIErrors.push(newError); } - return { errors: jsonAPIErrrors }; + return { errors: jsonAPIErrors }; } } \ No newline at end of file diff --git a/addon/converter/fixture-converter.js b/addon/converter/fixture-converter.js index 2cdf9800..7a4aed48 100644 --- a/addon/converter/fixture-converter.js +++ b/addon/converter/fixture-converter.js @@ -14,11 +14,11 @@ import Ember from 'ember'; If there are associations in the base fixture, they will be added to the new fixture as 'side loaded' elements, even if they are another json payload - built whith the build/buildList methods. + built with the build/buildList methods. @param {DS.Store} store @param {Object} options - transformKeys tranform keys and values in fixture if true + transformKeys transform keys and values in fixture if true serializeMode act like serialization is for a return to server if true @constructor */ @@ -36,7 +36,7 @@ export default class { /** Convert an initial fixture into a final payload. This raw fixture can contain other json in relationships that were - built by FacoryGuy ( build, buildList ) methods + built by FactoryGuy ( build, buildList ) methods @param modelName @param fixture @@ -62,7 +62,7 @@ export default class { } /** - Empty respose is a special case, so use this method for generating it. + Empty response is a special case, so use this method for generating it. @param _ @param {Object} options useValue to override the null value that is passed diff --git a/addon/converter/jsonapi-fixture-converter.js b/addon/converter/jsonapi-fixture-converter.js index 3070ce5a..ccbe0b12 100644 --- a/addon/converter/jsonapi-fixture-converter.js +++ b/addon/converter/jsonapi-fixture-converter.js @@ -28,7 +28,7 @@ class JSONAPIFixtureConverter extends Converter { } /** - * JSONAPIerializer does not use modelName for payload key, + * JSONAPISerializer does not use modelName for payload key, * and just has 'data' as the top level key. * * @param modelName diff --git a/addon/converter/rest-fixture-converter.js b/addon/converter/rest-fixture-converter.js index daf09447..9d38014a 100644 --- a/addon/converter/rest-fixture-converter.js +++ b/addon/converter/rest-fixture-converter.js @@ -20,7 +20,7 @@ export default class extends JSONFixtureConverter { } /** - * RESTSerializer has a paylaod key + * RESTSerializer has a payload key * * @param modelName * @param fixture diff --git a/addon/mocks/exposed-request-functions.js b/addon/mocks/exposed-request-functions.js index f449563d..d125e375 100644 --- a/addon/mocks/exposed-request-functions.js +++ b/addon/mocks/exposed-request-functions.js @@ -128,7 +128,7 @@ export function mockReload(...args) { let mockFindAll = mockFindAll('user').returns({json}); store.findAll('user').then(function(users){ - // 2 users, fisrt with whacky name, second isDude + // 2 users, first with whacky name, second isDude }); ``` @@ -284,7 +284,7 @@ export function mockQueryRecord(modelName, queryParams) { 2) If you match on a belongsTo association, you don't have to include that in the returns hash either. - @param {String} modelName name of model your creating like 'profile' for Profile + @param {String} modelName name of model you're creating like 'profile' for Profile */ export function mockCreate(modelName) { Ember.assert(`[ember-data-factory-guy] mockCreate requires at least a model type name`, modelName); diff --git a/addon/mocks/mock-create-request.js b/addon/mocks/mock-create-request.js index 5ca63b83..867b09e1 100644 --- a/addon/mocks/mock-create-request.js +++ b/addon/mocks/mock-create-request.js @@ -43,7 +43,7 @@ export default class MockCreateRequest extends AttributeMatcher(MockRequest) { } /** - This mock might be callled a few times in a row so, + This mock might be called a few times in a row so, Need to clone the responseJson and add id at the very last minute */ getResponse() { diff --git a/addon/mocks/mock-get-request.js b/addon/mocks/mock-get-request.js index 21776386..cd93d7ca 100644 --- a/addon/mocks/mock-get-request.js +++ b/addon/mocks/mock-get-request.js @@ -15,7 +15,7 @@ class MockGetRequest extends MockRequest { } /** - Used for inspecting the repsonse that this mock will generate + Used for inspecting the response that this mock will generate Usually the args will be an attribute like 'id', but it might also be a number like 0 or 1 for and index to list types. diff --git a/addon/model-definition.js b/addon/model-definition.js index 68b3ab7c..38cf1aaa 100644 --- a/addon/model-definition.js +++ b/addon/model-definition.js @@ -140,7 +140,7 @@ class ModelDefinition { let traitsObj = {}; traitArgs.forEach((trait)=> { if (!this.traits[trait]) { - Ember.warn(`[ember-data-factory-guy] Your trying to use a trait [${trait}] for model ${this.modelName} but that trait can not be found.`, null, { id: 'ember-data-factory-guy-trait-does-not-exist' }); + Ember.warn(`[ember-data-factory-guy] You're trying to use a trait [${trait}] for model ${this.modelName} but that trait can not be found.`, null, { id: 'ember-data-factory-guy-trait-does-not-exist' }); } $.extend(traitsObj, this.traits[trait]); }); @@ -167,7 +167,7 @@ class ModelDefinition { if (attributeType === 'function') { this.addFunctionAttribute(fixture, attribute); } else if (attributeType === 'object') { - this.addObjectAtribute(fixture, attribute); + this.addObjectAttribute(fixture, attribute); } } } catch (e) { @@ -189,7 +189,7 @@ class ModelDefinition { fixture[attribute] = fixture[attribute].call(this, fixture); } - addObjectAtribute(fixture, attribute) { + addObjectAttribute(fixture, attribute) { // If it's an object and it's a model association attribute, build the json // for the association and replace the attribute with that json let relationship = this.getRelationship(attribute); diff --git a/addon/utils/manual-setup.js b/addon/utils/manual-setup.js index 35734861..8344dffb 100644 --- a/addon/utils/manual-setup.js +++ b/addon/utils/manual-setup.js @@ -1,4 +1,4 @@ -// For manually setting up FactoryGuy in unit/integration tests where the applicaiton is not started +// For manually setting up FactoryGuy in unit/integration tests where the application is not started import FactoryGuy from '../factory-guy'; import loadFactories from './load-factories'; import loadScenarios from './load-scenarios'; diff --git a/tests/dummy/app/tests/factories/cat.js b/tests/dummy/app/tests/factories/cat.js index fbd99f3c..7af72004 100644 --- a/tests/dummy/app/tests/factories/cat.js +++ b/tests/dummy/app/tests/factories/cat.js @@ -3,8 +3,8 @@ import FactoryGuy from 'ember-data-factory-guy'; FactoryGuy.define('cat', { polymorphic: false, default: { - // usually, an attribute named 'type' is for polymorphic models, but the defenition - // is set as NOT polymorphic, which allows this type to work as attibute + // usually, an attribute named 'type' is for polymorphic models, but the definition + // is set as NOT polymorphic, which allows this type to work as attribute type: 'Cute', name: (f)=> `Cat ${f.id}`, friend: (f)=> `Friend ${f.id}` diff --git a/tests/helpers/utility-methods.js b/tests/helpers/utility-methods.js index 62be4c1e..ccf6bb2f 100644 --- a/tests/helpers/utility-methods.js +++ b/tests/helpers/utility-methods.js @@ -119,7 +119,7 @@ function containerSetup(container, serializerType) { store.serializerFor = function(modelName) { // all the modelFragment types will use their own default serializer - // and manager is always REST serialiezr ( used in rest tests ) + // and manager is always REST serializer ( used in rest tests ) let originalSerializer = findSerializer(modelName); if (modelName.match(/(name|department|address|department-employment|manager)/)) { return originalSerializer; diff --git a/tests/unit/drf-adapter-test.js b/tests/unit/drf-adapter-test.js index 1d0ec76c..77556b8d 100644 --- a/tests/unit/drf-adapter-test.js +++ b/tests/unit/drf-adapter-test.js @@ -38,7 +38,7 @@ SharedFactoryGuyTestHelperBehavior.mockUpdateReturnsEmbeddedAssociations(seriali moduleFor('serializer:application', `${serializer} #mockDelete`, inlineSetup(serializerType)); SharedFactoryGuyTestHelperBehavior.mockDeleteTests(); -moduleFor('serializer:application', `${serializer} DRFAdapeter | #mockQuery | meta`, inlineSetup(serializerType)); +moduleFor('serializer:application', `${serializer} DRFAdapter | #mockQuery | meta`, inlineSetup(serializerType)); // drf serializer takes the previous and next and extracts the page number // so this needed it's own test test("with proxy payload", function(assert) { diff --git a/tests/unit/factory-guy-test.js b/tests/unit/factory-guy-test.js index 8e0ce72a..7a74b191 100644 --- a/tests/unit/factory-guy-test.js +++ b/tests/unit/factory-guy-test.js @@ -15,7 +15,7 @@ test("has store set in initializer", function(assert) { assert.ok(FactoryGuy.store instanceof DS.Store); }); -test('make throws excpetion if there is NO store setup', function(assert) { +test('make throws exception if there is NO store setup', function(assert) { FactoryGuy.store = null; assert.throws( function() { @@ -26,7 +26,7 @@ test('make throws excpetion if there is NO store setup', function(assert) { }); }); -test('makeList throws excpetion if there is NO store setup', function(assert) { +test('makeList throws exception if there is NO store setup', function(assert) { FactoryGuy.store = null; assert.throws( function() { diff --git a/tests/unit/models/profile-test.js b/tests/unit/models/profile-test.js index cda7a161..7c5a8105 100644 --- a/tests/unit/models/profile-test.js +++ b/tests/unit/models/profile-test.js @@ -20,7 +20,7 @@ test('composing a profile with a company association by making both', function(a assert.ok(profile.get('company.profile') === profile); }); -test('using this.subject for profile and make for company associaion', function(assert) { +test('using this.subject for profile and make for company association', function(assert) { let profile = this.subject({company: make('company')}); assert.ok(profile.get('company.profile') === profile); }); diff --git a/tests/unit/models/user-test.js b/tests/unit/models/user-test.js index 1c0bce0f..d722c839 100644 --- a/tests/unit/models/user-test.js +++ b/tests/unit/models/user-test.js @@ -8,7 +8,7 @@ import { test, moduleForModel } from 'ember-qunit'; But you do need to user moduleForModel instead of just module - As long as your using ember 2.3 of have ember-getowner-pollyfill addon installed + As long as you're using ember 2.3 of have ember-getowner-pollyfill addon installed this style should work for you, and be speedier than calling startApp() If this does not work for you ( for whatever reason ) take a look at diff --git a/tests/unit/shared-factory-guy-test-helper-tests.js b/tests/unit/shared-factory-guy-test-helper-tests.js index a6ddb847..b6127bc6 100644 --- a/tests/unit/shared-factory-guy-test-helper-tests.js +++ b/tests/unit/shared-factory-guy-test-helper-tests.js @@ -528,7 +528,7 @@ SharedBehavior.mockFindAllSideloadingTests = function(serializer, serializerType // let json = buildList('profile', 'with_company'); // mockFindAll('profile').withParams({include: 'company'}).returns({ json }); // - // FactoryGuy.store.findAll('profile', {inlcude: 'company'}).then(function(profiles) { + // FactoryGuy.store.findAll('profile', {include: 'company'}).then(function(profiles) { // ok(profiles.get('firstObject.company.name') === 'Silly corp'); // done(); // }); @@ -770,7 +770,7 @@ SharedBehavior.mockQueryTests = function() { }); }); - test("reusing mock query using returns with differnet models and different params returns different results", function(assert) { + test("reusing mock query using returns with different models and different params returns different results", function(assert) { Ember.run(()=> { let done = assert.async(); @@ -824,7 +824,7 @@ SharedBehavior.mockQueryTests = function() { }); }); - test("reusing mock query using returns with differnt models and withParams with different params returns different results", function(assert) { + test("reusing mock query using returns with different models and withParams with different params returns different results", function(assert) { Ember.run(()=> { let done = assert.async(); @@ -966,7 +966,7 @@ SharedBehavior.mockQueryRecordTests = function() { }); }); - test("twice using returns with differnet json and different params returns different results", function(assert) { + test("twice using returns with different json and different params returns different results", function(assert) { Ember.run(()=> { let done = assert.async(); @@ -987,7 +987,7 @@ SharedBehavior.mockQueryRecordTests = function() { }); }); - test("reusing mock using returns with differnt json and withParams with different params returns different results", function(assert) { + test("reusing mock using returns with different json and withParams with different params returns different results", function(assert) { Ember.run(()=> { let done = assert.async(); diff --git a/tests/unit/utils/helper-functions-test.js b/tests/unit/utils/helper-functions-test.js index 8db892c8..868e09c4 100644 --- a/tests/unit/utils/helper-functions-test.js +++ b/tests/unit/utils/helper-functions-test.js @@ -82,7 +82,7 @@ test('#isEquivalent with objects', function(assert) { test('#isEquivalent with deeply nested objects', function(assert) { // we don't use nestedTomster or nestedZoey in the friends array to avoid - // infinite recurrsion + // infinite recursion let nestedTomster = { name: tomster.name,