2024-09-29 05:47:10 -05:00
|
|
|
import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest';
|
|
|
|
|
2022-09-27 15:56:17 -05:00
|
|
|
import { initialSetup, yarnModernUtils } from '@verdaccio/test-cli-commons';
|
2022-09-17 04:35:10 -05:00
|
|
|
|
|
|
|
import { getYarnCommand, yarn } from './utils';
|
|
|
|
|
|
|
|
describe('install a packages', () => {
|
2024-09-29 05:47:10 -05:00
|
|
|
vi.setConfig({ testTimeout: 90000 });
|
2022-09-17 04:35:10 -05:00
|
|
|
let registry;
|
|
|
|
let projectFolder;
|
|
|
|
|
|
|
|
beforeAll(async () => {
|
|
|
|
const setup = await initialSetup();
|
|
|
|
registry = setup.registry;
|
|
|
|
await registry.init();
|
2022-09-27 15:56:17 -05:00
|
|
|
const { tempFolder } = await yarnModernUtils.prepareYarnModernProject(
|
2022-09-17 04:35:10 -05:00
|
|
|
'yarn-2',
|
|
|
|
registry.getRegistryUrl(),
|
2022-09-27 15:56:17 -05:00
|
|
|
getYarnCommand(),
|
|
|
|
{
|
|
|
|
packageName: '@scope/name',
|
|
|
|
version: '1.0.0',
|
|
|
|
dependencies: { jquery: '3.6.0' },
|
|
|
|
devDependencies: {},
|
|
|
|
}
|
2022-09-17 04:35:10 -05:00
|
|
|
);
|
|
|
|
projectFolder = tempFolder;
|
|
|
|
});
|
|
|
|
|
|
|
|
test('should run yarn install', async () => {
|
|
|
|
const resp = await yarn(projectFolder, 'install');
|
|
|
|
expect(resp.stdout).toMatch(/Completed/);
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async () => {
|
|
|
|
registry.stop();
|
|
|
|
});
|
|
|
|
});
|