1
- import chalk from "chalk "
1
+ import { gray , green , red } from "colorette "
2
2
import assert from "node:assert/strict"
3
3
import { suite , test } from "node:test"
4
4
import stripAnsi from "strip-ansi"
@@ -13,12 +13,17 @@ suite("assertNoDiff.json", function() {
13
13
test ( "mismatching data" , function ( ) {
14
14
const obj1 = { firstName : "Jean-Luc" , lastName : "Picard" }
15
15
const obj2 = { firstName : "Captain" , lastName : "Picard" }
16
- const expected = chalk `mismatching objects:
16
+ const expected = `mismatching objects:
17
17
18
- {grey \{\n}{red "firstName": "Jean-Luc",\n}{green "firstName": "Captain",\n}{grey "lastName": "Picard"\n\}}`
19
- assert . throws ( function ( ) {
20
- assertNoDiff . json ( obj2 , obj1 )
21
- } , new Error ( expected ) )
18
+ ${ gray ( "{\n" ) } ${ red ( " \"firstName\": \"Jean-Luc\",\n" ) } ${ green ( " \"firstName\": \"Captain\",\n" ) } ${
19
+ gray ( " \"lastName\": \"Picard\"\n}" )
20
+ } `
21
+ assert . throws (
22
+ function ( ) {
23
+ assertNoDiff . json ( obj2 , obj1 )
24
+ } ,
25
+ new Error ( expected )
26
+ )
22
27
} )
23
28
24
29
test ( "no expected value" , function ( ) {
0 commit comments