0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/e2e-cli
Justin Johansson b121e3662f
Indiescripter/align website format lint configs (#2398)
* build: update deps dompurify, esbuild-loader, envinfo, express-rate-limit, fastify, handlebars, jsdom

* build: remove unused devDep wait-on

* build: update dep http-status-codes

* build: update devDeps @typescript-eslint/*; deps aws-sdk & memfs

* build: update devDep terser-webpack-plugin

* build: update devDep eslint-plugin-prettier

* build: update dev/devDeps node-fetch, react-hook-form

* build: update e2e-cli deps npm & pnpm

* build: update website devDev sass

* build: update ui-theme devDep github-markdown-css

* build: update logger dep pino minor version

* build: update web devDep node-html-parser

* build: remove some legacy flow-typed cruft

* style: eslint-config-airbnb-typescript => @verdaccio/eslint-config; use prettier width 100 in website

* fix: attempt eslint fix in Features.tsx as suggested by @semoal; website eslint still 1 error

* fix: attempt to fix eslint warn about hooks usage

Co-authored-by: Sergio Moreno <22656541+semoal@users.noreply.github.com>
2021-09-01 19:15:15 +02:00
..
config enable CLI E2e on 5.x (#2011) 2021-04-09 17:54:28 +02:00
projects build: configure prettier as formatter for json, yaml and markdown (#1930) 2021-04-09 17:54:19 +02:00
setup build: upgrade to jest 27 (#2297) 2021-06-13 09:14:04 +02:00
test_bk feat: flexible user interface generator (#2070) 2021-04-09 17:54:38 +02:00
utils enable CLI E2e on 5.x (#2011) 2021-04-09 17:54:28 +02:00
.babelrc enable CLI E2e on 5.x (#2011) 2021-04-09 17:54:28 +02:00
.eslintrc chore: extend lint rules to root 2021-04-09 17:54:12 +02:00
CHANGELOG.md chore: update versions (alpha) (#2053) 2021-04-09 17:54:33 +02:00
env_babel.js chore: extend lint rules to root 2021-04-09 17:54:12 +02:00
env_setup.js chore: extend lint rules to root 2021-04-09 17:54:12 +02:00
env_teardown.js chore: extend lint rules to root 2021-04-09 17:54:12 +02:00
jest.config.e2e.cli.js enable CLI E2e on 5.x (#2011) 2021-04-09 17:54:28 +02:00
LICENSE enable CLI E2e on 5.x (#2011) 2021-04-09 17:54:28 +02:00
package.json Indiescripter/align website format lint configs (#2398) 2021-09-01 19:15:15 +02:00
README.md refactor: enable e2e for UI (#2036) 2021-04-09 17:54:29 +02:00
tsconfig.json enable CLI E2e on 5.x (#2011) 2021-04-09 17:54:28 +02:00

E2E CLI Testing

What is included on these test?

  • Default configuration only
  • Basic commands eg (install / add, info, publish).
  • Test with 3 package managers (yarn classic, pnpm and npm@7)

How it works?

On run test suites, there is a global setup where will install the local source code of verdaccio in a temporary folder. Each suite will install.

  1. spawn a registry on port 6001 using _bootstrap_verdaccio.yaml which block any local package being fetched from remote upstream.
  2. Publish local project to the spawned registry (with global pnpm)

The published verdaccio should be fetch by each suite to ensure reliability of each test.

How to write test?

Each of the suite must use a package manager command (eg: npm install) and validate the output according what the user see, either verifying the outcome in JSON form, run a command (eg: jest ..) and the expected result.

Each Test should start with the initial setup, this step does the following

  • beforeAll: Install verdaccio to the suite context that returns a Setup object.
  • afterAll: Stop the child process that runs verdaccio.
beforeAll(async () => {
  setup = await initialSetup(tempRootFolder, port);
  console.log('--setup', setup.install);
});

stop the process is the final step that should occur in every suite.

afterAll(async () => {
  setup.child.kill();
});

What should not included on these tests?

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