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