Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@symfony/stimulus-testing
Advanced tools
Readme
Symfony UX Stimulus testing is a low-level package to help write tests for Stimulus controllers in applications and reusable packages.
Symfony UX Stimulus testing is currently considered experimental.
yarn add @symfony/stimulus-testing
Symfony UX Stimulus testing ships several tools to help write tests for Stimulus controllers:
To start using Symfony UX Testing, you first need to configure a testing environment:
Create a assets/test
directory ;
Create a assets/test/setup.js
file to initialize Symfony UX Testing:
import '@symfony/ux-testing/setup';
assets/jest.config.js
file for Jest configuration:module.exports = {
'testRegex': 'test/.*\\.test.js',
'setupFilesAfterEnv': ['./test/setup.js']
};
assets/.babelrc
file for Babel configuration (you may need to install Babel,
@babel/plugin-proposal-class-properties
and @babel/preset-env
if you haven't already):{
"presets": ["@babel/env"],
"plugins": ["@babel/plugin-proposal-class-properties"]
}
hello_controller.test.js
:import { Application } from '@hotwired/stimulus';
import { clearDOM, mountDOM } from '@symfony/stimulus-testing';
import HelloController from '../controllers/hello_controller.js';
const startStimulus = () => {
const application = Application.start();
application.register('hello', HelloController);
};
describe('HelloController', () => {
let container;
beforeEach(() => {
container = mountDOM('<div data-controller="hello"></div>');
});
afterEach(() => {
clearDOM();
});
it('connect', async () => {
startStimulus();
// Write a test here ...
});
// You can create other tests here
});
FAQs
@testing-library integration for Symfony UX
The npm package @symfony/stimulus-testing receives a total of 617 weekly downloads. As such, @symfony/stimulus-testing popularity was classified as not popular.
We found that @symfony/stimulus-testing demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.