0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/e2e/cli
Juan Picado 554020ec70
chore: update versions (6-next) (#3437)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-10-17 07:29:58 +02:00
..
cli-commons chore: update versions (6-next) (#3437) 2022-10-17 07:29:58 +02:00
e2e-npm6 refactor: reimplement star command (#3410) 2022-10-01 00:14:20 +02:00
e2e-npm7 refactor: reimplement star command (#3410) 2022-10-01 00:14:20 +02:00
e2e-npm8 refactor: reimplement star command (#3410) 2022-10-01 00:14:20 +02:00
e2e-npm9 fix(deps): update all core dependencies (master) (#3440) 2022-10-15 21:51:29 +02:00
e2e-pnpm6 refactor: reimplement star command (#3410) 2022-10-01 00:14:20 +02:00
e2e-pnpm7 refactor: reimplement star command (#3410) 2022-10-01 00:14:20 +02:00
e2e-yarn1 e2e: command dist-tag (#3390) 2022-09-24 08:53:03 +02:00
e2e-yarn2 e2e: yarn publish (#3393) 2022-09-27 22:56:17 +02:00
e2e-yarn3 fix(deps): update all core dependencies (master) (#3440) 2022-10-15 21:51:29 +02:00
e2e-yarn4 e2e: yarn publish (#3393) 2022-09-27 22:56:17 +02:00
jest.config.js
README.md refactor: reimplement star command (#3410) 2022-10-01 00:14:20 +02:00

E2E CLI Testing

What is included on these test?

  • Default configuration only
  • Test with all popular package managers:
  • yarn classic and yarn modern (2, 3, 4 RC)
  • pnpm 6, 7
  • npm 6, 7, 8 and 9

Commands Tested

cmd npm6 npm7 npm8 npm9 pnpm6 pnpm7 yarn1 yarn2 yarn3 yarn4
publish
info
audit
install
deprecate
ping
search
star
dist-tag

notes:

  • yarn search cmd exist in modern but, it do not uses the search registry endpoint.
  • yarn modern has two info commands, the one used here is yarn npm info

= no tested = tested = no supported

How it works?

Every package manager + version is a package in the monorepo.

The package @verdaccio/test-cli-commons contains helpers used for each package manager.

import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';

The registry can be executed with the following commands, the port is automatically assigned.

// setup
const setup = await initialSetup();
registry = setup.registry;
await registry.init();
// teardown
registry.stop();

The full url can be get from registry.getRegistryUrl(). The yarn modern does not allows the --registry so need a more complex step, while others is just enough adding the following to every command.

await yarn({ cwd: tempFolder }, 'install', ...addRegistry(registry.getRegistryUrl()));

The most of the command allow return output in JSON format which helps with the expects.

const resp = await yarn(
  { cwd: tempFolder },
  'audit',
  '--json',
  ...addRegistry(registry.getRegistryUrl())
);
const parsedBody = JSON.parse(resp.stdout as string);
expect(parsedBody.type).toEqual('auditSummary');

Every command should test either console output or in special cases look up the storage manually.

What should not included on these tests?

  • Anything is unrelated with client commands usage, eg: (auth permissions, third party integrations, hooks, plugins)