@@ -22,23 +22,37 @@ describe('The "dist" folder', () => {
2222
2323 } ) ;
2424
25+ ////////////////////////////////////////////////////////////////////////////////
26+ describe ( 'Library version number' , ( ) => {
27+
28+ it ( 'follows semantic version formatting' , ( ) => {
29+ const version = esmToPlainJs . version ;
30+ const semVer = / \d + [ . ] \d + [ . ] \d + / ;
31+ const actual = { version : version , valid : semVer . test ( version ) } ;
32+ const expected = { version : version , valid : true } ;
33+ assertDeepStrictEqual ( actual , expected ) ;
34+ } ) ;
35+
36+ } ) ;
37+
2538////////////////////////////////////////////////////////////////////////////////
2639describe ( 'Library module' , ( ) => {
2740
28- it ( 'is an object' , ( ) => {
29- const actual = { constructor : esmToPlainJs . constructor . name } ;
30- const expected = { constructor : 'Object ' } ;
41+ it ( 'is exported as an object' , ( ) => {
42+ const actual = { type : typeof esmToPlainJs } ;
43+ const expected = { type : 'object ' } ;
3144 assertDeepStrictEqual ( actual , expected ) ;
3245 } ) ;
3346
34- it ( 'has functions named assert(), cli(), reporter(), and transform() ' , ( ) => {
47+ it ( 'has the correct properties ' , ( ) => {
3548 const module = esmToPlainJs ;
3649 const actual = Object . keys ( module ) . sort ( ) . map ( key => [ key , typeof module [ key ] ] ) ;
3750 const expected = [
3851 [ 'assertOk' , 'function' ] ,
3952 [ 'cli' , 'function' ] ,
4053 [ 'reporter' , 'function' ] ,
4154 [ 'transform' , 'function' ] ,
55+ [ 'version' , 'string' ] ,
4256 ] ;
4357 assertDeepStrictEqual ( actual , expected ) ;
4458 } ) ;
0 commit comments