-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
test.js
12 lines (11 loc) · 606 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
import path from 'path';
import test from 'ava';
import resolvePkg from '.';
test('main', t => {
t.is(resolvePkg('nonexistent'), undefined);
t.is(resolvePkg('nonexistent/foo'), undefined);
t.is(path.relative('.', resolvePkg('grunt-svgmin')), 'node_modules/grunt-svgmin');
t.is(path.relative('.', resolvePkg('grunt-svgmin/tasks')), 'node_modules/grunt-svgmin/tasks');
t.is(path.relative('.', resolvePkg('@someprivate/module-test')), 'node_modules/@someprivate/module-test');
t.is(path.relative('.', resolvePkg('@someprivate/module-test/subdir')), 'node_modules/@someprivate/module-test/subdir');
});