forked from parcel-bundler/parcel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetCurrentPackageManager.test.js
More file actions
28 lines (27 loc) · 928 Bytes
/
Copy pathgetCurrentPackageManager.test.js
File metadata and controls
28 lines (27 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// @flow
import assert from 'assert';
import getCurrentPackageManager from '../src/getCurrentPackageManager';
describe('getCurrentPackageManager', () => {
it('yarn', () => {
const npm_config_user_agent = 'yarn/1.22.21 npm/? node/v21.1.0 darwin x64';
const currentPackageManager = getCurrentPackageManager(
npm_config_user_agent,
);
assert(currentPackageManager?.name, 'yarn');
});
it('npm', () => {
const npm_config_user_agent =
'npm/10.2.0 node/v21.1.0 darwin x64 workspaces/true';
const currentPackageManager = getCurrentPackageManager(
npm_config_user_agent,
);
assert(currentPackageManager?.name, 'npm');
});
it('pnpm', () => {
const npm_config_user_agent = 'pnpm/8.14.2 npm/? node/v18.17.1 darwin x64';
const currentPackageManager = getCurrentPackageManager(
npm_config_user_agent,
);
assert(currentPackageManager?.name, 'pnpm');
});
});