Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@cypress/angular
Advanced tools
Mount Angular components in the open source Cypress.io test runner v7.0.0+
Note: This package is bundled with the
cypress
package and should not need to be installed separately. See the Angular Component Testing Docs for mounting Angular components. Installing and importingmount
from@cypress/angular
should only be used for advanced use-cases.
npm install --save-dev @cypress/angular
Open cypress test runner
npx cypress open --component
If you need to run test in CI
npx cypress run --component
For more information, please check the official docs for running Cypress and for component testing.
mount
is the most important function, allows to mount a given Angular component as a mini web application and interact with it using Cypress commandsMountConfig
Configuration used to configure your testcreateOutputSpy
factory function that creates new EventEmitter for your component and spies on it's emit
method.import { mount } from '@cypress/angular'
import { HelloWorldComponent } from './hello-world.component'
describe('HelloWorldComponent', () => {
it('works', () => {
mount(HelloWorldComponent)
// now use standard Cypress commands
cy.contains('Hello World!').should('be.visible')
})
})
import { mount } from '@cypress/angular'
import { HelloWorldComponent } from './hello-world.component'
describe('HelloWorldComponent', () => {
it('works', () => {
mount('<app-hello-world></app-hello-world>', {
declarations: [HelloWorldComponent]
})
// now use standard Cypress commands
cy.contains('Hello World!').should('be.visible')
})
})
Look at the examples in cypress-component-testing-apps repo. Here in the angular
and angular-standalone
folders are the two example applications showing various testing scenarios.
@cypress/angular | cypress |
---|---|
>= v1 | >= v10.5 |
Run yarn build
to compile and sync packages to the cypress
cli package.
This project is licensed under the terms of the MIT license.
FAQs
Test Angular Components using Cypress
The npm package @cypress/angular receives a total of 1,493 weekly downloads. As such, @cypress/angular popularity was classified as popular.
We found that @cypress/angular demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.