Git Product home page Git Product logo

ember-cli-chai's Introduction

ember-cli-chai

npm Build Status

Chai assertions for Ember.js.

Deprecated

This package is deprecated. Please use ember-auto-import to use chai and chai plugins directly. If you'd like to use chai, or were previously using ember-cli-chai, follow these instructions to use chai in your app:

Add ember-auto-import and chai to your project:

ember install ember-auto-import chai

Next, if you are using any plugins, add the following to tests/test-helper.js before calling start from ember-mocha to ensure chai has loaded them:

// tests/test-helper.js
import { start } from 'ember-mocha';
import chai from 'chai';
import chaiDom from 'chai-dom';
chai.use(chaiDom);
start();

Installation

ember install ember-cli-chai

Usage

After installing ember-cli-chai you can import Chai from the chai package:

import chai from 'chai';

or import the expect() function directly:

import { expect } from 'chai';

Have a look at the vendor shim file to understand what else can be imported this way.

QUnit

Previous versions of ember-cli-chai supported QUnit but due to changes in chai itself this is unfortunately no longer viable. For readable DOM assertions in QUnit we recommend qunit-dom instead.

Chai plugins

ember-cli-chai is able to automatically load a number of popular Chai plugins:

All you have to do is install those plugins via npm install --save-dev. Once they are installed and listed as dependencies in your package.json file they will be used automatically.

Using chai-jquery for example will enable you to write JQuery assertions like:

expect(find('.test-element')).to.have.text('hello');

License

ember-cli-chai is licensed under the MIT License.

ember-cli-chai's People

Contributors

turbo87 avatar dependabot-preview[bot] avatar dependabot[bot] avatar dependabot-support avatar jonathankingston avatar alexlafroscia avatar rwjblue avatar dhaulagiri avatar cherewaty avatar fivetanley avatar ember-tomster avatar polarctos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.