1 | var readInstalled = require('../read-installed.js')
|
2 | var test = require('tap').test
|
3 | var path = require('path');
|
4 |
|
5 | function allValid(t, map) {
|
6 | var deps = Object.keys(map.dependencies || {})
|
7 | deps.forEach(function (dep) {
|
8 | t.notOk(map.dependencies[dep].invalid, 'dependency ' + dep + ' of ' + map.name + ' is not invalid')
|
9 | t.notOk(typeof map.dependencies[dep] === 'string', 'dependency ' + dep + ' of ' + map.name + ' is not missing')
|
10 | })
|
11 | deps.forEach(function (dep) {
|
12 | allValid(t, map.dependencies[dep])
|
13 | })
|
14 | }
|
15 |
|
16 | test('grandparent can satisfy peer dependencies', function(t) {
|
17 | readInstalled(
|
18 | path.join(__dirname, 'fixtures/grandparent-peer'),
|
19 | { log: console.error },
|
20 | function(err, map) {
|
21 | allValid(t, map)
|
22 | t.end()
|
23 | })
|
24 | })
|