Skip to content

Commit

Permalink
beauty assert json
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyumih committed Nov 4, 2023
1 parent 39f06da commit fcbdf00
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions assert/assert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ namespace $ {
'three must be alike'() {
$mol_assert_like( [ 3 ] , [ 3 ] , [ 3 ] )
} ,

'two object must be alike'() {
$mol_assert_like( { a: 1 }, { a: 1 } )
} ,

'three object must be alike'() {
$mol_assert_like( { a: 1 }, { a: 1 }, { a: 1 } )
} ,

} )
}
2 changes: 1 addition & 1 deletion assert/assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace $ {
if( 'outerHTML' in val ) return val.outerHTML

try {
return JSON.stringify( val )
return JSON.stringify( val, null, '\t' )
} catch( error: any ) {
console.error( error )
return val
Expand Down
1 change: 1 addition & 0 deletions assert/demo/demo.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ $mol_assert_demo $mol_example_code
\$mol_assert_unique( 1 , 2 , 3 )
\$mol_assert_equal( 1 , 1 , 1 )
\$mol_assert_like( [1] , [1] , [1] )
\$mol_assert_like( { a: 1 } , { a: 1 } , { a: 1 } )
aspects /
\Algorithm/Assert
\Testing

0 comments on commit fcbdf00

Please sign in to comment.