1
1
import { peerIdFromString } from '@libp2p/peer-id'
2
2
import { multiaddr } from '@multiformats/multiaddr'
3
3
import { expect } from 'aegir/chai'
4
- import debug from 'debug'
5
4
import { Key } from 'interface-datastore'
6
5
import { base32 } from 'multiformats/bases/base32'
7
6
import { base58btc } from 'multiformats/bases/base58'
8
7
import { base64 } from 'multiformats/bases/base64'
9
8
import sinon from 'sinon'
10
9
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
11
10
import { toString as unint8ArrayToString } from 'uint8arrays/to-string'
11
+ import debug from 'weald'
12
12
import { logger , peerLogger } from '../src/index.js'
13
13
14
14
describe ( 'logger' , ( ) => {
15
15
it ( 'creates a logger' , ( ) => {
16
16
const log = logger ( 'hello' )
17
17
18
18
expect ( log ) . to . be . a ( 'function' )
19
- expect ( log ) . to . a . property ( 'enabled' ) . that . is . not . true ( )
19
+ expect ( log ) . to . have . property ( 'enabled' ) . that . is . not . true ( )
20
20
expect ( log ) . to . have . property ( 'error' ) . that . is . a ( 'function' )
21
21
expect ( log ) . to . have . nested . property ( 'error.enabled' ) . that . is . not . true ( )
22
22
expect ( log ) . to . have . property ( 'trace' ) . that . is . a ( 'function' )
@@ -29,7 +29,7 @@ describe('logger', () => {
29
29
const log = logger . forComponent ( 'hello' )
30
30
31
31
expect ( log ) . to . be . a ( 'function' )
32
- expect ( log ) . to . a . property ( 'enabled' ) . that . is . not . true ( )
32
+ expect ( log ) . to . have . property ( 'enabled' ) . that . is . not . true ( )
33
33
expect ( log ) . to . have . property ( 'error' ) . that . is . a ( 'function' )
34
34
expect ( log ) . to . have . nested . property ( 'error.enabled' ) . that . is . not . true ( )
35
35
expect ( log ) . to . have . property ( 'trace' ) . that . is . a ( 'function' )
@@ -42,7 +42,7 @@ describe('logger', () => {
42
42
const log = logger ( 'enabled-logger' )
43
43
44
44
expect ( log ) . to . be . a ( 'function' )
45
- expect ( log ) . to . a . property ( 'enabled' ) . that . is . true ( )
45
+ expect ( log ) . to . have . property ( 'enabled' ) . that . is . true ( )
46
46
expect ( log ) . to . have . property ( 'error' ) . that . is . a ( 'function' )
47
47
expect ( log ) . to . have . nested . property ( 'error.enabled' ) . that . is . not . true ( )
48
48
expect ( log ) . to . have . property ( 'trace' ) . that . is . a ( 'function' )
@@ -55,7 +55,7 @@ describe('logger', () => {
55
55
const log = logger ( 'enabled-with-error-logger' )
56
56
57
57
expect ( log ) . to . be . a ( 'function' )
58
- expect ( log ) . to . a . property ( 'enabled' ) . that . is . true ( )
58
+ expect ( log ) . to . have . property ( 'enabled' ) . that . is . true ( )
59
59
expect ( log ) . to . have . property ( 'error' ) . that . is . a ( 'function' )
60
60
expect ( log ) . to . have . nested . property ( 'error.enabled' ) . that . is . true ( )
61
61
expect ( log ) . to . have . property ( 'trace' ) . that . is . a ( 'function' )
@@ -68,7 +68,7 @@ describe('logger', () => {
68
68
const log = logger ( 'enabled-with-trace-logger' )
69
69
70
70
expect ( log ) . to . be . a ( 'function' )
71
- expect ( log ) . to . a . property ( 'enabled' ) . that . is . true ( )
71
+ expect ( log ) . to . have . property ( 'enabled' ) . that . is . true ( )
72
72
expect ( log ) . to . have . property ( 'error' ) . that . is . a ( 'function' )
73
73
expect ( log ) . to . have . nested . property ( 'error.enabled' ) . that . is . true ( )
74
74
expect ( log ) . to . have . property ( 'trace' ) . that . is . a ( 'function' )
0 commit comments