Skip to content

running codemod on rendering tests breaks on < character #240

@hmajoros

Description

@hmajoros

I've been running the codemod on all of my project's rendering tests, ala anything that has

import { setupRenderingTest } from 'ember-qunit';

We've actually had pretty good success for the most part, but I have noticed a fun / interesting bug: If you test JS file contains the character < inside a string, or inside a comment block, the codemod seemingly attempts to parse this as HTML & blows up. A few examples we had were things like:

test('assert correct string for < 99 records', async function(assert) { ... }
/**
 * @Title: assert that <memberName> is generated correctly
 */

Our workaround has been to just delete the characters < and > from any string / comment, run codemod, then add the characters back. Would be great is the codemod could be configured to only run on the actual hbs blocks inside the test instead of the entire file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions