11import test from 'tape'
22import { assert } from '../index.js'
33
4- test ( 'assert(imageReference)' , function ( t ) {
4+ test ( 'assert(imageReference)' , ( t ) => {
55 t . throws (
6- function ( ) {
6+ ( ) => {
77 assert ( { type : 'imageReference' } )
88 } ,
99 / ` i d e n t i f i e r ` m u s t b e ` s t r i n g ` : ` { t y p e : ' i m a g e R e f e r e n c e ' } ` $ / ,
1010 'should throw if `imageReference` has no `identifier`'
1111 )
1212
1313 t . throws (
14- function ( ) {
14+ ( ) => {
1515 assert ( { type : 'imageReference' , identifier : 1 } )
1616 } ,
1717 / ` i d e n t i f i e r ` m u s t b e ` s t r i n g ` : ` { t y p e : ' i m a g e R e f e r e n c e ' , i d e n t i f i e r : 1 } ` $ / ,
1818 'should throw if `identifier` is not a `string`'
1919 )
2020
21- t . doesNotThrow ( function ( ) {
21+ t . doesNotThrow ( ( ) => {
2222 assert ( { type : 'imageReference' , identifier : '1' } )
2323 } , 'should not throw if `imageReference` has no other properties' )
2424
2525 t . throws (
26- function ( ) {
26+ ( ) => {
2727 assert ( { type : 'imageReference' , identifier : '1' , alt : 1 } )
2828 } ,
2929 / ` a l t ` m u s t b e ` s t r i n g ` : ` { t y p e : ' i m a g e R e f e r e n c e ' , i d e n t i f i e r : ' 1 ' , a l t : 1 } ` $ / ,
3030 'should throw if `alt` is not a `string`'
3131 )
3232
3333 t . throws (
34- function ( ) {
34+ ( ) => {
3535 assert ( { type : 'imageReference' , identifier : '1' , referenceType : 1 } )
3636 } ,
3737 / ` r e f e r e n c e T y p e ` m u s t b e ` s h o r t c u t ` , ` c o l l a p s e d ` , o r ` f u l l ` : ` { t y p e : ' i m a g e R e f e r e n c e ' , i d e n t i f i e r : ' 1 ' , r e f e r e n c e T y p e : 1 } ` $ / ,
3838 'should throw if `referenceType` is not a `string`'
3939 )
4040
41- t . doesNotThrow ( function ( ) {
41+ t . doesNotThrow ( ( ) => {
4242 assert ( {
4343 type : 'imageReference' ,
4444 identifier : '1' ,
@@ -47,7 +47,7 @@ test('assert(imageReference)', function (t) {
4747 } , 'should not throw if `referenceType` is valid' )
4848
4949 t . throws (
50- function ( ) {
50+ ( ) => {
5151 assert ( { type : 'imageReference' , identifier : '1' , label : 1 } )
5252 } ,
5353 / ` l a b e l ` m u s t b e ` s t r i n g ` : ` { t y p e : ' i m a g e R e f e r e n c e ' , i d e n t i f i e r : ' 1 ' , l a b e l : 1 } ` $ / ,
0 commit comments