Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@ember/test-helpers
Advanced tools
@ember/test-helpers is a package that provides a set of utilities to facilitate testing in Ember.js applications. It offers a variety of helpers to interact with the DOM, handle asynchronous operations, and manage application state during tests.
Rendering Helpers
Rendering helpers allow you to render components or templates in the test environment. This is useful for testing the output and behavior of your UI components.
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
await render(hbs`<MyComponent />`);
DOM Interaction
DOM interaction helpers enable you to simulate user interactions such as clicking buttons or filling in input fields. This helps in testing how your application responds to user actions.
import { click, fillIn } from '@ember/test-helpers';
await click('.my-button');
await fillIn('.my-input', 'new value');
Asynchronous Helpers
Asynchronous helpers like `settled` ensure that all asynchronous operations have completed before proceeding with the test. This is crucial for testing asynchronous behavior in your application.
import { settled } from '@ember/test-helpers';
await settled();
Routing Helpers
Routing helpers allow you to navigate to different routes within your application during tests. This is useful for testing the behavior of your application in different states and routes.
import { visit } from '@ember/test-helpers';
await visit('/my-route');
ember-qunit provides QUnit-specific helpers for testing Ember.js applications. It integrates seamlessly with @ember/test-helpers and offers additional utilities for setting up and tearing down tests.
ember-mocha offers Mocha-specific helpers for testing Ember.js applications. Similar to ember-qunit, it works well with @ember/test-helpers and provides a Mocha-based testing environment.
ember-cli-page-object is a library for creating page objects in Ember.js tests. It provides a higher-level API for interacting with your application's UI, making tests more readable and maintainable.
A test-framework-agnostic set of helpers for testing Ember.js applications
If you are writing a regular Ember app or addon there is not much for you to do as ember-qunit (and ember-mocha) already include this package as a dependency. You only need to make sure that you are using a recent enough version of either one of these packages.
If you are working on ember-qunit
or ember-mocha
themselves you can
install this package like any other regular Ember addon.
This package exports several helper functions that can be used to improve the testing experience when developing Ember.js apps or addons.
These helper functions include DOM interaction helpers (click()
, fillIn()
,
...), routing and rendering helpers (visit()
, render()
, ...) and some
other things that make it easy to write good tests.
The full documentation can be found in the API reference.
git clone <repository-url>
cd ember-test-helpers
yarn install
yarn test
(Runs ember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
ember serve
For more information on using ember-cli, visit https://ember-cli.com/.
Much of ember-test-helpers
was extracted from the original ember-qunit
,
which was written by Stefan Penner, Robert Jackson, and Ryan Florence.
Copyright 2015 Switchfly and contributors.
Dual-licensed under the Apache License, Version 2.0 and the MIT License.
v1.7.1 (2019-10-25)
typeIn
does not await settled()
after each event (@jakebixbyavalara)FAQs
Helpers for testing Ember.js applications
We found that @ember/test-helpers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.