@@ -93,136 +93,6 @@ test('fromParse5', async function (t) {
9393 } )
9494 } )
9595
96- await t . test ( 'should accept a file as options' , async function ( ) {
97- assert . deepEqual (
98- fromParse5 ( parse ( String ( file ) , { sourceCodeLocationInfo : true } ) , file ) ,
99- {
100- type : 'root' ,
101- children : [
102- {
103- type : 'element' ,
104- tagName : 'html' ,
105- properties : { } ,
106- children : [
107- {
108- type : 'element' ,
109- tagName : 'head' ,
110- properties : { } ,
111- children : [
112- {
113- type : 'element' ,
114- tagName : 'title' ,
115- properties : { } ,
116- children : [
117- {
118- type : 'text' ,
119- value : 'Hello!' ,
120- position : {
121- start : { line : 1 , column : 8 , offset : 7 } ,
122- end : { line : 1 , column : 14 , offset : 13 }
123- }
124- }
125- ] ,
126- position : {
127- start : { line : 1 , column : 1 , offset : 0 } ,
128- end : { line : 1 , column : 22 , offset : 21 }
129- }
130- }
131- ]
132- } ,
133- {
134- type : 'element' ,
135- tagName : 'body' ,
136- properties : { } ,
137- children : [
138- {
139- type : 'element' ,
140- tagName : 'h1' ,
141- properties : { } ,
142- children : [
143- {
144- type : 'text' ,
145- value : 'World!' ,
146- position : {
147- start : { line : 1 , column : 26 , offset : 25 } ,
148- end : { line : 1 , column : 32 , offset : 31 }
149- }
150- }
151- ] ,
152- position : {
153- start : { line : 1 , column : 22 , offset : 21 } ,
154- end : { line : 1 , column : 32 , offset : 31 }
155- }
156- }
157- ]
158- }
159- ]
160- }
161- ] ,
162- data : { quirksMode : true } ,
163- position : {
164- start : { line : 1 , column : 1 , offset : 0 } ,
165- end : { line : 1 , column : 32 , offset : 31 }
166- }
167- }
168- )
169- } )
170-
171- await t . test (
172- 'should accept a file as options (without location info)' ,
173- async function ( ) {
174- assert . deepEqual ( fromParse5 ( parse ( String ( file ) ) , file ) , {
175- type : 'root' ,
176- children : [
177- {
178- type : 'element' ,
179- tagName : 'html' ,
180- properties : { } ,
181- children : [
182- {
183- type : 'element' ,
184- tagName : 'head' ,
185- properties : { } ,
186- children : [
187- {
188- type : 'element' ,
189- tagName : 'title' ,
190- properties : { } ,
191- children : [
192- {
193- type : 'text' ,
194- value : 'Hello!'
195- }
196- ]
197- }
198- ]
199- } ,
200- {
201- type : 'element' ,
202- tagName : 'body' ,
203- properties : { } ,
204- children : [
205- {
206- type : 'element' ,
207- tagName : 'h1' ,
208- properties : { } ,
209- children : [
210- {
211- type : 'text' ,
212- value : 'World!'
213- }
214- ]
215- }
216- ]
217- }
218- ]
219- }
220- ] ,
221- data : { quirksMode : true }
222- } )
223- }
224- )
225-
22696 await t . test ( 'should support synthetic locations' , async function ( ) {
22797 assert . deepEqual (
22898 fromParse5 (
@@ -246,7 +116,7 @@ test('fromParse5', async function (t) {
246116 startOffset : 0
247117 }
248118 } ,
249- file
119+ { file}
250120 ) ,
251121 {
252122 type : 'element' ,
@@ -295,7 +165,7 @@ test('fromParse5', async function (t) {
295165 startOffset : 0
296166 }
297167 } ,
298- file
168+ { file}
299169 ) ,
300170 {
301171 type : 'element' ,
0 commit comments