this repo has no description

isolated issue in edge-cases.test.ts

+77 -51
+23
src/edge-cases.test.ts
··· 1 + import assert from 'node:assert' 2 + import { describe, test } from 'node:test' 3 + import { treeify } from './index.js' 4 + 5 + describe('edge cases', () => { 6 + test('root with nested children and sibling', () => { 7 + const input = [ 8 + 'root', 9 + ['child1', ['grandchild1', 'grandchild2']], 10 + 'sibling', 11 + ] 12 + const expected = `root 13 + ├─ child1 14 + │ ├─ grandchild1 15 + │ └─ grandchild2 16 + └─ sibling` 17 + 18 + const result = treeify(input) 19 + console.log('\nRoot with nested children and sibling:') 20 + console.log(result) 21 + assert.strictEqual(result, expected) 22 + }) 23 + })
-51
src/index.test.ts
··· 132 132 console.log(`\n${treeify(input3)}`) 133 133 }) 134 134 }) 135 - 136 - describe('readme examples', () => { 137 - test('basic example', () => { 138 - const eagan = [ 139 - 'Kier Eagan', 140 - ['...', ['...', 'Jame Eagan', ['Helena Eagan']]], 141 - 'Ambrose Eagan', 142 - ] 143 - const expected = `Kier Eagan 144 - ├─ ... 145 - | ├─ ... 146 - | └─ Jame Eagan 147 - | └─ Helena Eagan 148 - └─ Ambrose Eagan` 149 - 150 - const result = treeify(eagan) 151 - console.log('\nBasic example:') 152 - console.log(result) 153 - assert.strictEqual(result, expected) 154 - }) 155 - 156 - test('nested example', () => { 157 - const orgChart = [ 158 - 'Lumon Industries', 159 - [ 160 - 'Board of Directors', 161 - ['Natalie (Representative)'], 162 - 'Department Heads', 163 - [ 164 - 'Cobel (MDR)', 165 - ['Milchick', 'Mark S.', ['Dylan G.', 'Irving B.', 'Helly R.']], 166 - ], 167 - ], 168 - ] 169 - const expected = `Lumon Industries 170 - ├─ Board of Directors 171 - │ └─ Natalie (Representative) 172 - └─ Department Heads 173 - └─ Cobel (MDR) 174 - ├─ Milchick 175 - └─ Mark S. 176 - ├─ Dylan G. 177 - ├─ Irving B. 178 - └─ Helly R.` 179 - 180 - const result = treeify(orgChart) 181 - console.log('\nNested example:') 182 - console.log(result) 183 - assert.strictEqual(result, expected) 184 - }) 185 - })
+54
src/readme-examples.test.ts
··· 1 + import assert from 'node:assert' 2 + import { describe, test } from 'node:test' 3 + import { treeify } from './index.js' 4 + 5 + describe('readme examples', () => { 6 + test('basic example', () => { 7 + const eagan = [ 8 + 'Kier Eagan', 9 + ['...', ['...', 'Jame Eagan', ['Helena Eagan']]], 10 + 'Ambrose Eagan', 11 + ] 12 + const expected = `Kier Eagan 13 + ├─ ... 14 + | ├─ ... 15 + | └─ Jame Eagan 16 + | └─ Helena Eagan 17 + └─ Ambrose Eagan` 18 + 19 + const result = treeify(eagan) 20 + console.log('\nBasic example:') 21 + console.log(result) 22 + assert.strictEqual(result, expected) 23 + }) 24 + 25 + test('nested example', () => { 26 + const orgChart = [ 27 + 'Lumon Industries', 28 + [ 29 + 'Board of Directors', 30 + ['Natalie (Representative)'], 31 + 'Department Heads', 32 + [ 33 + 'Cobel (MDR)', 34 + ['Milchick', 'Mark S.', ['Dylan G.', 'Irving B.', 'Helly R.']], 35 + ], 36 + ], 37 + ] 38 + const expected = `Lumon Industries 39 + ├─ Board of Directors 40 + │ └─ Natalie (Representative) 41 + └─ Department Heads 42 + └─ Cobel (MDR) 43 + ├─ Milchick 44 + └─ Mark S. 45 + ├─ Dylan G. 46 + ├─ Irving B. 47 + └─ Helly R.` 48 + 49 + const result = treeify(orgChart) 50 + console.log('\nNested example:') 51 + console.log(result) 52 + assert.strictEqual(result, expected) 53 + }) 54 + })