-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathundefined.js
27 lines (25 loc) · 1.15 KB
/
undefined.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('undefined', () => {
it('returns `undefined`', () => {
expect(inspect(undefined)).to.equal('undefined')
})
describe('colors', () => {
it('returns string with grey color, if colour is set to true', () => {
expect(inspect(undefined, { colors: true })).to.equal('\u001b[90mundefined\u001b[39m')
})
})
describe('truncate', () => {
it('returns the full string representation regardless of truncate', () => {
expect(inspect(undefined, { truncate: 9 })).to.equal('undefined')
expect(inspect(undefined, { truncate: 8 })).to.equal('undefined')
expect(inspect(undefined, { truncate: 7 })).to.equal('undefined')
expect(inspect(undefined, { truncate: 6 })).to.equal('undefined')
expect(inspect(undefined, { truncate: 5 })).to.equal('undefined')
expect(inspect(undefined, { truncate: 4 })).to.equal('undefined')
expect(inspect(undefined, { truncate: 3 })).to.equal('undefined')
expect(inspect(undefined, { truncate: 2 })).to.equal('undefined')
expect(inspect(undefined, { truncate: 1 })).to.equal('undefined')
})
})
})