@@ -3,49 +3,58 @@ import test from 'node:test'
3
3
import { embedded } from './index.js'
4
4
import * as mod from './index.js'
5
5
6
- test ( 'embedded' , ( ) => {
7
- assert . deepEqual (
8
- Object . keys ( mod ) . sort ( ) ,
9
- [ 'embedded' ] ,
10
- 'should expose the public api'
11
- )
6
+ test ( 'embedded' , async function ( t ) {
7
+ await t . test ( 'should expose the public api' , async function ( ) {
8
+ assert . deepEqual ( Object . keys ( mod ) . sort ( ) , [ 'embedded' ] )
9
+ } )
12
10
13
- // @ts -expect-error: check how a missing node is handled.
14
- assert . equal ( embedded ( ) , false , 'should return `false` without node' )
11
+ await t . test ( 'should return `false` without node' , async function ( ) {
12
+ // @ts -expect-error: check how a missing node is handled.
13
+ assert . equal ( embedded ( ) , false )
14
+ } )
15
15
16
- assert . equal ( embedded ( null ) , false , 'should return `false` with `null`' )
16
+ await t . test ( 'should return `false` with `null`' , async function ( ) {
17
+ assert . equal ( embedded ( null ) , false )
18
+ } )
17
19
18
- assert . equal (
19
- embedded ( { type : 'text' } ) ,
20
- false ,
21
- 'should return `false` when without `element`'
20
+ await t . test (
21
+ 'should return `false` when without `element`' ,
22
+ async function ( ) {
23
+ assert . equal ( embedded ( { type : 'text' } ) , false )
24
+ }
22
25
)
23
26
24
- assert . equal (
25
- embedded ( { type : 'element' } ) ,
26
- false ,
27
- 'should return `false` when with invalid `element`'
27
+ await t . test (
28
+ 'should return `false` when with invalid `element`' ,
29
+ async function ( ) {
30
+ assert . equal ( embedded ( { type : 'element' } ) , false )
31
+ }
28
32
)
29
33
30
- assert . equal (
31
- embedded ( {
32
- type : 'element' ,
33
- tagName : 'a' ,
34
- properties : { href : '#alpha' , title : 'Bravo' } ,
35
- children : [ { type : 'text' , value : 'Charlie' } ]
36
- } ) ,
37
- false ,
38
- 'should return `false` when without not embedded'
34
+ await t . test (
35
+ 'should return `false` when without not embedded' ,
36
+ async function ( ) {
37
+ assert . equal (
38
+ embedded ( {
39
+ type : 'element' ,
40
+ tagName : 'a' ,
41
+ properties : { href : '#alpha' , title : 'Bravo' } ,
42
+ children : [ { type : 'text' , value : 'Charlie' } ]
43
+ } ) ,
44
+ false
45
+ )
46
+ }
39
47
)
40
48
41
- assert . equal (
42
- embedded ( {
43
- type : 'element' ,
44
- tagName : 'audio' ,
45
- properties : { src : 'delta.ogg' } ,
46
- children : [ ]
47
- } ) ,
48
- true ,
49
- 'should return `true` when with embedded'
50
- )
49
+ await t . test ( 'should return `true` when with embedded' , async function ( ) {
50
+ assert . equal (
51
+ embedded ( {
52
+ type : 'element' ,
53
+ tagName : 'audio' ,
54
+ properties : { src : 'delta.ogg' } ,
55
+ children : [ ]
56
+ } ) ,
57
+ true
58
+ )
59
+ } )
51
60
} )
0 commit comments