@@ -15,45 +15,14 @@ const transform = (content: string) => transformJavascript(
15
15
{ content, getTransforms : [ getPrefixFunctionsTransformer ] } ) . content ;
16
16
17
17
describe ( 'prefix-functions' , ( ) => {
18
- const emptyImportsComment = '/** PURE_IMPORTS_START PURE_IMPORTS_END */' ;
19
18
const clazz = 'var Clazz = (function () { function Clazz() { } return Clazz; }());' ;
20
19
21
- describe ( 'pure imports' , ( ) => {
22
- it ( 'adds import list' , ( ) => {
23
- const input = tags . stripIndent `
24
- import { Injectable } from '@angular/core';
25
- import { Something } from './relative/pure_import';
26
- var foo = Injectable;
27
- var bar = Something;
28
- ` ;
29
- const output = tags . stripIndent `
30
- /** PURE_IMPORTS_START _angular_core,_relative_pure_import PURE_IMPORTS_END */
31
- ${ input }
32
- ` ;
33
-
34
- expect ( tags . oneLine `${ transform ( input ) } ` ) . toEqual ( tags . oneLine `${ output } ` ) ;
35
- } ) ;
36
-
37
- it ( 'adds import list even with no imports' , ( ) => {
38
- const input = tags . stripIndent `
39
- var foo = 42;
40
- ` ;
41
- const output = tags . stripIndent `
42
- ${ emptyImportsComment }
43
- ${ input }
44
- ` ;
45
-
46
- expect ( tags . oneLine `${ transform ( input ) } ` ) . toEqual ( tags . oneLine `${ output } ` ) ;
47
- } ) ;
48
- } ) ;
49
-
50
20
describe ( 'pure functions' , ( ) => {
51
21
it ( 'adds comment to new calls' , ( ) => {
52
22
const input = tags . stripIndent `
53
23
var newClazz = new Clazz();
54
24
` ;
55
25
const output = tags . stripIndent `
56
- ${ emptyImportsComment }
57
26
var newClazz = /*@__PURE__*/ new Clazz();
58
27
` ;
59
28
@@ -65,7 +34,6 @@ describe('prefix-functions', () => {
65
34
var newClazz = Clazz();
66
35
` ;
67
36
const output = tags . stripIndent `
68
- ${ emptyImportsComment }
69
37
var newClazz = /*@__PURE__*/ Clazz();
70
38
` ;
71
39
@@ -78,7 +46,6 @@ describe('prefix-functions', () => {
78
46
var ClazzTwo = (function () { function Clazz() { } return Clazz; })();
79
47
` ;
80
48
const output = tags . stripIndent `
81
- ${ emptyImportsComment }
82
49
var Clazz = /*@__PURE__*/ (function () { function Clazz() { } return Clazz; }());
83
50
var ClazzTwo = /*@__PURE__*/ (function () { function Clazz() { } return Clazz; })();
84
51
` ;
@@ -99,7 +66,6 @@ describe('prefix-functions', () => {
99
66
};
100
67
` ;
101
68
const output = tags . stripIndent `
102
- ${ emptyImportsComment }
103
69
${ input }
104
70
` ;
105
71
@@ -118,7 +84,6 @@ describe('prefix-functions', () => {
118
84
export { MyFunction };
119
85
` ;
120
86
const output = tags . stripIndent `
121
- ${ emptyImportsComment }
122
87
${ input }
123
88
` ;
124
89
@@ -137,7 +102,6 @@ describe('prefix-functions', () => {
137
102
}
138
103
` ;
139
104
const output = tags . stripIndent `
140
- ${ emptyImportsComment }
141
105
${ input }
142
106
` ;
143
107
@@ -156,7 +120,6 @@ describe('prefix-functions', () => {
156
120
};
157
121
` ;
158
122
const output = tags . stripIndent `
159
- ${ emptyImportsComment }
160
123
${ input }
161
124
` ;
162
125
@@ -172,7 +135,6 @@ describe('prefix-functions', () => {
172
135
};
173
136
` ;
174
137
const output = tags . stripIndent `
175
- ${ emptyImportsComment }
176
138
${ input }
177
139
` ;
178
140
0 commit comments