ember-codemods / ember-qunit-codemod

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid replacement of `module('', () => {})`

panthony opened this issue · comments

After using this codemod my tests where not running at all anymore with a very cryptic stacktrace:

index.js:626 Uncaught TypeError: a.localeCompare is not a function
    at index.js:626
    at Array.sort (:4200/native)
    at Array.<anonymous> (index.js:625)
    at runLoggingCallbacks (browser.js:146)
    at begin (formatio.js:167)
    at formatio.js:134

Where not a single line where helpful.

After trying to migrate folder by folder I finally were able to pinpoint the culprit.

One of my test file was looking like this:

module('Unit | Lib | visualisations', () => {
 // bunch of tests
});

And was translated to

module(() => {
 // bunch of tests
}, function() {});

Awesome, thank you for tracking this down!!