We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8f0d54 commit d48086dCopy full SHA for d48086d
test/lib/root.js
@@ -0,0 +1,19 @@
1
+const { test } = require('tap')
2
+const requireInject = require('require-inject')
3
+
4
+test('root', (t) => {
5
+ t.plan(3)
6
+ const dir = '/root/dir'
7
8
+ const root = requireInject('../../lib/root.js', {
9
+ '../../lib/npm.js': { dir },
10
+ '../../lib/utils/output.js': (output) => {
11
+ t.equal(output, dir, 'prints the correct directory')
12
+ }
13
+ })
14
15
+ root([], (err) => {
16
+ t.ifError(err, 'npm root')
17
+ t.ok('should have printed directory')
18
19
+})
0 commit comments