Skip to content

Commit 1c8ed9b

Browse files
committed
Simplified describe tree
1 parent dd20c4d commit 1c8ed9b

File tree

1 file changed

+43
-46
lines changed

1 file changed

+43
-46
lines changed

test/test.js

+43-46
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,54 @@ var assert = require('assert'),
66
g = chalk.green,
77
m = chalk.magenta
88

9-
describe('Jsome', function () {
10-
11-
describe('run with', function () {
12-
describe('spec non-compliant coloured output', function () {
13-
var expected = y('{') +
14-
'\n ' + g('string') + y(': ') + y('"') + m('value') + y('"') +
15-
y(',') +
16-
'\n ' + g('list') + y(': ') + y('[') + y('"') + m('one') + y('"') +
17-
y(', ') + y('"') + m('two') +
18-
y('"') + y(']') +
19-
'\n' + y('}')
20-
var actual = mJsome.getColoredString(
21-
{'string': 'value', 'list': ['one', 'two']}
22-
)
23-
24-
test('should return a simple non-standard json string', function () {
25-
assert.equal(actual, expected)
26-
})
27-
28-
test('should return a simple non-standard ANSI escaped, json string',
29-
function () {
30-
assert.equal(enc(actual), enc(expected))
31-
})
32-
9+
describe('Jsome run with', function () {
10+
11+
describe('spec non-compliant coloured output', function () {
12+
var expected = y('{') +
13+
'\n ' + g('string') + y(': ') + y('"') + m('value') + y('"') +
14+
y(',') +
15+
'\n ' + g('list') + y(': ') + y('[') + y('"') + m('one') + y('"') +
16+
y(', ') + y('"') + m('two') +
17+
y('"') + y(']') +
18+
'\n' + y('}')
19+
var actual = mJsome.getColoredString(
20+
{'string': 'value', 'list': ['one', 'two']}
21+
)
22+
23+
test('should return a simple non-standard json string', function () {
24+
assert.equal(actual, expected)
3325
})
3426

35-
describe('spec compliant coloured output', function () {
36-
var expected = y('{') +
37-
'\n ' + y('"') + g('string') + y('"') + y(': ') + y('"') + m('value') +
38-
y('"') +
39-
y(',') +
40-
'\n ' + y('"') + g('list') + y('"') + y(': ') + y('[') + y('"') +
41-
m('one') + y('"') +
42-
y(', ') + y('"') + m('two') +
43-
y('"') + y(']') +
44-
'\n' + y('}')
45-
mJsome.params.lintable = true
46-
var actual = mJsome.getColoredString(
47-
{'string': 'value', 'list': ['one', 'two']}
48-
)
49-
50-
test('should return a simple non-standard json string', function () {
51-
assert.equal(actual, expected)
27+
test('should return a simple non-standard ANSI escaped, json string',
28+
function () {
29+
assert.equal(enc(actual), enc(expected))
5230
})
5331

54-
test('should return a simple non-standard ANSI escaped, json string',
55-
function () {
56-
assert.equal(enc(actual), enc(expected))
57-
})
32+
})
33+
34+
describe('spec compliant coloured output', function () {
35+
var expected = y('{') +
36+
'\n ' + y('"') + g('string') + y('"') + y(': ') + y('"') + m('value') +
37+
y('"') +
38+
y(',') +
39+
'\n ' + y('"') + g('list') + y('"') + y(': ') + y('[') + y('"') +
40+
m('one') + y('"') +
41+
y(', ') + y('"') + m('two') +
42+
y('"') + y(']') +
43+
'\n' + y('}')
44+
mJsome.params.lintable = true
45+
var actual = mJsome.getColoredString(
46+
{'string': 'value', 'list': ['one', 'two']}
47+
)
48+
49+
test('should return a simple non-standard json string', function () {
50+
assert.equal(actual, expected)
5851
})
5952

53+
test('should return a simple non-standard ANSI escaped, json string',
54+
function () {
55+
assert.equal(enc(actual), enc(expected))
56+
})
6057
})
61-
58+
6259
})

0 commit comments

Comments
 (0)