Skip to content

this.on(var gets undefined does not match field "name" #201

Description

@kellyselden
    ['myAction1', 'myAction2'].forEach(action => {
      this.on(action, () => {
        // ...
      });
    });
 ERR tests/integration/components/my-camera-test.js Transformation error (undefined does not match field "name": string of type Identifier)
Error: undefined does not match field "name": string of type Identifier
    at addParam (C:\Users\kelly\AppData\Roaming\npm-cache\_npx\6296\node_modules\ember-qunit-codemod\node_modules\ast-types\lib\types.js:565:23)
    at C:\Users\kelly\AppData\Roaming\npm-cache\_npx\6296\node_modules\ember-qunit-codemod\node_modules\ast-types\lib\types.js:594:21
    at Array.forEach (<anonymous>)
    at Function.identifier (C:\Users\kelly\AppData\Roaming\npm-cache\_npx\6296\node_modules\ember-qunit-codemod\node_modules\ast-types\lib\types.js:592:30)
    at NodePath.<anonymous> (C:\Users\kelly\AppData\Roaming\npm-cache\_npx\6296\node_modules\ember-qunit-codemod\transforms\convert-module-for-to-setup-test/index.js:806:24)
    at C:\Users\kelly\AppData\Roaming\npm-cache\_npx\6296\node_modules\ember-qunit-codemod\node_modules\jscodeshift\src\Collection.js:77:36
    at Array.forEach (<anonymous>)
    at Collection.forEach (C:\Users\kelly\AppData\Roaming\npm-cache\_npx\6296\node_modules\ember-qunit-codemod\node_modules\jscodeshift\src\Collection.js:76:18)
    at updateOnCalls (C:\Users\kelly\AppData\Roaming\npm-cache\_npx\6296\node_modules\ember-qunit-codemod\transforms\convert-module-for-to-setup-test/index.js:804:12)
    at NodePath.<anonymous> (C:\Users\kelly\AppData\Roaming\npm-cache\_npx\6296\node_modules\ember-qunit-codemod\transforms\convert-module-for-to-setup-test/index.js:724:13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions