File tree Expand file tree Collapse file tree 2 files changed +37
-7
lines changed Expand file tree Collapse file tree 2 files changed +37
-7
lines changed Original file line number Diff line number Diff line change 1
- /* eslint-env mocha */
1
+ import { assert } from '@open-wc/testing'
2
+ import '../src/index.ts'
2
3
3
4
let count
4
5
const responses = {
@@ -228,23 +229,51 @@ suite('include-fragment-element', function () {
228
229
)
229
230
} )
230
231
231
- test ( 'data is not writable' , function ( ) {
232
+ test ( 'data is not writable' , async function ( ) {
232
233
const el = document . createElement ( 'include-fragment' )
233
- assert . ok ( el . data !== 42 )
234
+ let data
235
+ try {
236
+ data = await el . data
237
+ } catch {
238
+ data = null
239
+ }
240
+ assert . ok ( data !== 42 )
234
241
try {
235
242
el . data = 42
243
+ } catch ( e ) {
244
+ assert . ok ( e )
236
245
} finally {
237
- assert . ok ( el . data !== 42 )
246
+ let data
247
+ try {
248
+ data = await el . data
249
+ } catch {
250
+ data = null
251
+ }
252
+ assert . ok ( data !== 42 )
238
253
}
239
254
} )
240
255
241
- test ( 'data is not configurable' , function ( ) {
256
+ test ( 'data is not configurable' , async function ( ) {
242
257
const el = document . createElement ( 'include-fragment' )
243
- assert . ok ( el . data !== undefined )
258
+ let data
259
+ try {
260
+ data = await el . data
261
+ } catch {
262
+ data = null
263
+ }
264
+ assert . ok ( data !== undefined )
244
265
try {
245
266
delete el . data
267
+ } catch ( e ) {
268
+ assert . ok ( e )
246
269
} finally {
247
- assert . ok ( el . data !== undefined )
270
+ let data
271
+ try {
272
+ data = await el . data
273
+ } catch {
274
+ data = null
275
+ }
276
+ assert . ok ( data !== undefined )
248
277
}
249
278
} )
250
279
Original file line number Diff line number Diff line change 3
3
"module" : " es2020" ,
4
4
"target" : " es2017" ,
5
5
"strict" : true ,
6
+ "moduleResolution" : " node" ,
6
7
"declaration" : true ,
7
8
"outDir" : " dist" ,
8
9
"removeComments" : true
You can’t perform that action at this time.
0 commit comments