-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathnull.js
27 lines (25 loc) · 1.03 KB
/
null.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import inspect from '../lib/index.js'
import { expect } from 'chai'
describe('null', () => {
it('returns `null`', () => {
expect(inspect(null)).to.equal('null')
})
describe('colors', () => {
it('returns string with bold color, if colour is set to true', () => {
expect(inspect(null, { colors: true })).to.equal('\u001b[1mnull\u001b[22m')
})
})
describe('truncate', () => {
it('returns the full string representation regardless of truncate', () => {
expect(inspect(null, { truncate: 9 })).to.equal('null')
expect(inspect(null, { truncate: 8 })).to.equal('null')
expect(inspect(null, { truncate: 7 })).to.equal('null')
expect(inspect(null, { truncate: 6 })).to.equal('null')
expect(inspect(null, { truncate: 5 })).to.equal('null')
expect(inspect(null, { truncate: 4 })).to.equal('null')
expect(inspect(null, { truncate: 3 })).to.equal('null')
expect(inspect(null, { truncate: 2 })).to.equal('null')
expect(inspect(null, { truncate: 1 })).to.equal('null')
})
})
})