Skip to content

Commit 0b447c2

Browse files
authored
Merge pull request #48 from alexander-alvarez/empty-import-bugfix
Empty import bugfix
2 parents caa1c0c + 028e292 commit 0b447c2

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import { module, test } from 'ember-qunit';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import { module, test } from 'qunit';

ember-qunit-codemod.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ module.exports = function(file, api, options) {
119119
emberQUnitImports
120120
.get('specifiers')
121121
.replace(Array.from(emberQUnitSpecifiers).map(s => j.importSpecifier(j.identifier(s))));
122+
123+
// If we have an empty import, remove the import declaration
124+
if (emberQUnitSpecifiers.size === 0) {
125+
emberQUnitImports.remove();
126+
}
122127
}
123128

124129
function updateEmberTestHelperImports() {

0 commit comments

Comments
 (0)