0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/e2e/cli
renovate[bot] 68bc817479
fix(deps): update dependency debug to v4.4.0 (#5003)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-15 15:15:09 +01:00
..
cli-commons fix(deps): update dependency debug to v4.4.0 (#5003) 2024-12-15 15:15:09 +01:00
e2e-npm-commons fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-npm6 fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-npm7 fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-npm8 fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-npm9 fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-npm10 fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-pnpm-commons fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-pnpm8 fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-pnpm9 fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-pnpm10 fix: unpublish a package on storage package (#4937) 2024-11-16 20:39:47 +01:00
e2e-yarn1 chore: vitest migration part 5 (#4914) 2024-10-20 19:26:36 +02:00
e2e-yarn2 final migration to vitest remove jest (#4978) 2024-12-07 21:48:32 +01:00
e2e-yarn3 final migration to vitest remove jest (#4978) 2024-12-07 21:48:32 +01:00
e2e-yarn4 final migration to vitest remove jest (#4978) 2024-12-07 21:48:32 +01:00
README.md chore: enable pnpm e2e ci (#4554) 2024-03-23 11:32:13 +01:00

E2E CLI Testing

What is included on these test?

  • Default configuration only
  • Test with all popular package managers

Commands Tested

cmd npm6 npm7 npm8 npm9 npm10 pnpm8 pnpm9 (beta) yarn1 yarn2 yarn3 yarn4
publish
info
audit
install
deprecate
ping
search
star
stars
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)