1- 'use strict'
2-
3- var test = require ( 'tape' )
4- var chalk = require ( 'chalk' )
5- var strip = require ( 'strip-ansi' )
6- var u = require ( 'unist-builder' )
7- var h = require ( 'hastscript' )
8- var x = require ( 'xastscript' )
9- var retext = require ( 'retext' )
10- var fromXml = require ( 'xast-util-from-xml' )
11- var inspect = require ( '.' )
1+ import test from 'tape'
2+ import chalk from 'chalk'
3+ import strip from 'strip-ansi'
4+ import u from 'unist-builder'
5+ import h from 'hastscript'
6+ import x from 'xastscript'
7+ import retext from 'retext'
8+ import fromXml from 'xast-util-from-xml'
9+ import { inspect , inspectColor , inspectNoColor } from './index.js'
1210
1311var chalkEnabled = new chalk . Instance ( { level : 1 } )
1412
@@ -17,16 +15,6 @@ var paragraph = 'Some simple text. Other “sentence”.'
1715test ( 'inspect' , function ( t ) {
1816 t . equal ( typeof inspect , 'function' , 'should be a `function`' )
1917
20- t . test ( 'should have `color` and `noColor` properties' , function ( st ) {
21- st . equal ( typeof inspect . color , 'function' )
22- st . equal ( typeof inspect . noColor , 'function' )
23-
24- st . equal ( typeof inspect . color . noColor , 'function' )
25- st . equal ( typeof inspect . noColor . color , 'function' )
26-
27- st . end ( )
28- } )
29-
3018 t . end ( )
3119} )
3220
@@ -69,7 +57,7 @@ test('inspect()', function (t) {
6957 t . test ( 'should work on non-nodes' , function ( st ) {
7058 st . equal ( strip ( inspect ( 'foo' ) ) , '"foo"' )
7159 st . equal ( strip ( inspect ( null ) ) , 'null' )
72- st . equal ( strip ( inspect ( NaN ) ) , 'null' )
60+ st . equal ( strip ( inspect ( Number . NaN ) ) , 'null' )
7361 st . equal ( strip ( inspect ( 3 ) ) , '3' )
7462
7563 st . end ( )
@@ -340,9 +328,9 @@ test('inspect()', function (t) {
340328 t . end ( )
341329} )
342330
343- test ( 'inspect.noColor ()' , function ( t ) {
331+ test ( 'inspectNoColor ()' , function ( t ) {
344332 t . equal (
345- inspect . noColor ( retext ( ) . parse ( paragraph ) . children [ 0 ] . children [ 0 ] ) ,
333+ inspectNoColor ( retext ( ) . parse ( paragraph ) . children [ 0 ] . children [ 0 ] ) ,
346334 [
347335 'SentenceNode[6] (1:1-1:18, 0-17)' ,
348336 '├─0 WordNode[1] (1:1-1:5, 0-4)' ,
@@ -361,9 +349,9 @@ test('inspect.noColor()', function (t) {
361349 t . end ( )
362350} )
363351
364- test ( 'inspect.color ()' , function ( t ) {
352+ test ( 'inspectColor ()' , function ( t ) {
365353 t . equal (
366- inspect . color ( retext ( ) . parse ( paragraph ) . children [ 0 ] . children [ 0 ] ) ,
354+ inspectColor ( retext ( ) . parse ( paragraph ) . children [ 0 ] . children [ 0 ] ) ,
367355 [
368356 chalkEnabled . bold ( 'SentenceNode' ) +
369357 chalkEnabled . dim ( '[' ) +
0 commit comments