Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
ember-test-helpers
Advanced tools
A test-framework-agnostic set of helpers for testing Ember.js applications.
This library is best used in conjunction with a test-framework-specific wrapper, such as ember-qunit or ember-mocha.
This library was written using ES6 modules, which are contained in lib/
.
These modules must be transpiled for pre-ES6 compatibility.
The TestModule
class is used to configure modules for unit testing
different aspects of your Ember application. This class can be extended to
create modules focused on particular types of unit tests.
TestModule
is intended to be used in conjunction with modules specific to
a test framework. For instance, you could create QUnit-compatible modules with
a method such as:
function moduleFor(name, description, callbacks) {
var module = new TestModule(name, description, callbacks);
QUnit.module(module.name, {
beforeEach() {
module.setup();
},
afterEach() {
module.teardown();
}
});
}
TestModule(name [, description [, callbacks]])
name
- the full name of the test subject as it is registered in a container
(e.g. 'controller:application', 'route:index', etc.).
description
(optional) - the description of the test module as it should be
displayed in test output. If omitted, defaults to name
.
callbacks
(optional) - an object that may include setup and teardown steps
as well as the other units needed by tests.
TestModuleForComponent
extends TestModule
to allow unit testing of Ember
Components.
TestModuleForComponent(name [, description [, callbacks]])
name
- the short name of the component that you'd use in a template
(e.g. 'x-foo', 'color-picker', etc.).TestModuleForModel
extends TestModule
to allow unit testing of Ember Data
Models.
TestModuleForModel(name [, description [, callbacks]])
name
- the short name of the model that you'd use in store operations
(e.g. 'user', 'assignmentGroup', etc.).getContext
/ setContext
- access the context to be used in each test.
setResolver
- sets the resolver which will be used to look up objects from
each test's container.
isolatedContainer
- creates a new isolated container for unit testing.
Contributions are welcome. Please follow the instructions below to install and test this library.
$ npm install
$ bower install
In order to test in the browser:
$ npm start
... and then visit http://localhost:4200/tests.
In order to perform a CI test:
$ npm test
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.
v0.6.3 (2017-03-04)
Fixed bugs:
FAQs
Helpers for testing Ember.js applications
The npm package ember-test-helpers receives a total of 6,285 weekly downloads. As such, ember-test-helpers popularity was classified as popular.
We found that ember-test-helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.