Skip to content

Commit 9aa00b5

Browse files
author
Robert Jackson
authored
Fix Comments being lost around modules (#199)
Fix Comments being lost around modules
2 parents eac1f9d + 05118f5 commit 9aa00b5

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//import RSVP from 'rsvp';
2+
import { module } from 'qunit';
3+
4+
module('Unit | whatever');
5+
6+
// test('commented out test', function(assert) {});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//import RSVP from 'rsvp';
2+
import { module } from 'qunit';
3+
4+
module('Unit | whatever', function() {});
5+
6+
// test('commented out test', function(assert) {});

transforms/convert-module-for-to-setup-test/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ module.exports = function(file, api) {
7777
subject = j.literal(`model:${calleeArguments[0].value}`);
7878
}
7979

80+
this.comments = p.node.comments;
81+
this.trailingComments = p.node.trailingComments;
82+
8083
this.originalSetupType = calleeName;
8184
this.moduleName = moduleName;
8285
this.moduleOptions = options;
@@ -451,6 +454,8 @@ module.exports = function(file, api) {
451454
}
452455
}
453456

457+
moduleInvocation.comments = moduleInfo.comments;
458+
moduleInvocation.trailingComments = moduleInfo.trailingComments;
454459
moduleInfo.moduleInvocation = moduleInvocation;
455460

456461
if (needsHooks === true) {

0 commit comments

Comments
 (0)