Skip to content

Commit

Permalink
Add test for "depth"-parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
nknapp committed May 5, 2017
1 parent 73788b7 commit f751bd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/fixtures/moduleWithDeps-depth1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
size: 24k... with-dependencies: 56k
├── dep1@1.0.0, 16k, 1 deps
└── dep2@1.0.0, 16k, 1 deps
8 changes: 8 additions & 0 deletions test/index-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ describe('The index-function (module main function):', function () {
expect(result).to.equal(fs.readFileSync('test/fixtures/moduleWithDeps.txt', 'utf-8'))
})
})

it('should cut the display at a specific depth if specified', function () {
return analyze('test/fixtures/moduleWithDeps', {depth: 1})
.then((result) => {
expect(result).to.equal(fs.readFileSync('test/fixtures/moduleWithDeps-depth1.txt', 'utf-8'))
})
})

})

0 comments on commit f751bd6

Please sign in to comment.