Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mmisty/cypress-allure-adapter

Package Overview
Dependencies
Maintainers
1
Versions
302
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mmisty/cypress-allure-adapter

cypress allure adapter to generate allure results during tests execution

  • 0.0.1-beta.2
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14K
decreased by-17.64%
Maintainers
1
Weekly downloads
 
Created
Source

cypress-template

Template to create cypress library with jest tests, correct package structure, coverage connected to cypress and merging coverage for jest and cypress

  • typescript support
  • code coverage for cypress and jest, merge coverage
  • formatting and eslint
  • jest tests
  • proper library extraction

Create repository using this template if you need to create cypress library.

Project structure

Locationdescription
srcall library code will be located here, see folder src section
integrationfolder contains cypress tests for testing the library, see folder integration section
testsfolder contains jest unit tests for testing the library
reportsdirectory that will be created after tests run with coverage info and reports
.scriptshelper scripts
.githubgithub actions workflows
.huskypre-commit hooks (install by npm run husky:install)
Folder src

Your library will contain only the code that located in this folder

LocationDescription
src/index.tsexport anything you want to be imported on user side from your library by '' that should run in browser
src/cypresswhen you library contains additional commands put types for your commands inside types.ts file

When using some other libraries in yours you can import its types within cypress.ts
Note: this folder should have cypress name for easier types setup when you library is ready (this way you will not need to add your library in tsconfig.json types section)
src/pluginswhen you library need to handle node events (register tasks or other things on node side) you can put it all here.
Export all required methods within index.ts file.
So when using library user imports will be '<your library name>/plugins'
src/setupall functions that should be run in browser, export within index.ts
src/utilssome functions that can be run on both environments - node and DOM (browser), export within index.ts
Folder integration
Locationdescription
integration/pluginsuse your plugins from src here
ts-preprocessor.ts is requiered to gather coverage info
integration/supportuse your src/support, import it replacing src with cy-local to have correct code coverage
integration/e2etests folder, use anything from src, import it replacing src with cy-local to have correct code coverage

Code coverage

Coverage is being gathered from cypress and from jest, after all tests finished coverages from both test packs will be merged

coverage-example

To see individual coverage reports run:

  • npm run cov:jest html report with coverage for jest tests
  • npm run cov:cy html report with coverage for jest tests
  • npm run cov html report with combined coverage

Extraction

Before publishing do not forget:

  • to increment package version for your package
  • fill all fields in package.json for your package

You can test your package by running npm run try:pack (All changes should be committed before that)

structure

Scripts

scriptdescription
husky:installinstall precommit hooks
lintlint code
buildcompile typescript by tsconfig.build.json
testrun all jest tests
test:covrun all jest tests with coverage
cy:openstart cypress in interactive mode
cy:open:covstart cypress in interactive mode with coverage
cy:runrun cypress tests
cy:run:covrun cypress tests with coverage
cov:mergemerge jest and cypress coverage results
cov:jestshow html report for jest coverage (http-server should be installed globally, npm i http-server -g)
cov:cyshow html report for cypress coverage (http-server should be installed globally, npm i http-server -g)
covshow html report for full coverage (http-server should be installed globally, npm i http-server -g)
cov:checkcheck coverage by thresholds specified in nyc.config.js
prerun all necessary scripts (fmt, lint, build, tests and check cov)
extractshould be run after tsc and after everything is staged. Extracts everything from 'lib' to root directory. This is required for nice imports in target library
extract:undoBe careful, commit everything you need before. Removes files and dirs that were extracted after extract
try:packtry to pack the library - will create archieve with library files

Keywords

FAQs

Package last updated on 04 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc