<commit_before>Ember CLI version: **0.1.2**

NPM package name: **sl-test-helpers**

License: [MIT](LICENSE.md)


---

# What is sl-test-helpers

This addon provides and registers QUnit test helpers for use in the testing of your application.


---

# Provided helpers

## Synchronous

### contains

```
contains( valuesUnderTest, valuesToTestFor, 'Message passed to ok()' );
```

Test whether values are contained in other values.  These values can be a combination of Arrays, Strings, or Objects (for which the keys are extracted).  All *valuesToTestFor* must exist in *valuesUnderTest* for this test to pass successfully.

This test would fail because the Object being tested does not contain keys matching the values of "a" and "b":

```
contains( { c: 1, b: 3 }, [ 'a', 'b' ], 'Contains expected values' );
```

This test would pass because the Array being tested contains the value of "b":

```
contains( [ 'a', 'b' ], 'b', 'Contains expected values' );
```

## Synchronous

### contains

See description in *Synchronous* section



---

# Utilities

There are several utility functions provided in the */test-support/helpers/sl/utils/utils.js* file that, while used internally by the helpers themselves, can be imported as needed for use.  These include:

* convertToArray()
* convertStringToArray()
* convertObjectKeysToArray()
* doArraysIntersect()


---

# How to use this addon in your application

## Install this addon as a Node module

```
npm install --save-dev sl-test-helpers
```

## If running Synchronous tests, such as Unit Tests

For each test helper you wish to use, you will need to import them into each individual Unit Tests. For example:

```
import { contains } from '../../helpers/sl/synchronous';
```

## If running Asynchronous tests, such as Acceptance Tests

You only need to run the blueprint:

```
ember generate sl-test-helpers
```

If your application is under source control management, such as via Git, make sure to commit the changes made to the following files by the generator:

* tests/helpers/start-app.js
* tests/.jshintrc


The generator makes changes to the above files assuming the structure of them has not changed much from the default version created during the initial Ember application creation.  If too many changes have been made you will need to manually make the changes below:

* Add `import slregisterTestHelpers from './sl/register-test-helpers';` to the beginning of the *tests/helpers/start-app.js* file
* In the *tests/helpers/start-app.js* file, place `slregisterTestHelpers();` before the `App.injectTestHelpers` line
* Add `"contains",` to the `predef` section of the */tests/.jshintrc* file


---

# Versioning
Employs [Semantic Versioning 2.0.0](http://semver.org/)

---

# Contribution
[See CONTRIBUTING.md](CONTRIBUTING.md)

---

# Copyright and License
sl-test-helpers and its source files are Copyright © 2014 [SoftLayer Technologies, Inc.](http://www.softlayer.com/)
The software is [MIT Licensed](LICENSE.md)


---

# Warranty
This software is provided “as is” and without any express or implied warranties, including, without limitation, the
implied warranties of merchantability and fitness for a particular purpose.<commit_msg>Correctly label "Asynchronous" section<commit_after>Ember CLI version: **0.1.2**

NPM package name: **sl-test-helpers**

License: [MIT](LICENSE.md)


---

# What is sl-test-helpers

This addon provides and registers QUnit test helpers for use in the testing of your application.


---

# Provided helpers

## Synchronous

### contains

```
contains( valuesUnderTest, valuesToTestFor, 'Message passed to ok()' );
```

Test whether values are contained in other values.  These values can be a combination of Arrays, Strings, or Objects (for which the keys are extracted).  All *valuesToTestFor* must exist in *valuesUnderTest* for this test to pass successfully.

This test would fail because the Object being tested does not contain keys matching the values of "a" and "b":

```
contains( { c: 1, b: 3 }, [ 'a', 'b' ], 'Contains expected values' );
```

This test would pass because the Array being tested contains the value of "b":

```
contains( [ 'a', 'b' ], 'b', 'Contains expected values' );
```

## Asynchronous

### contains

See description in *Synchronous* section



---

# Utilities

There are several utility functions provided in the */test-support/helpers/sl/utils/utils.js* file that, while used internally by the helpers themselves, can be imported as needed for use.  These include:

* convertToArray()
* convertStringToArray()
* convertObjectKeysToArray()
* doArraysIntersect()


---

# How to use this addon in your application

## Install this addon as a Node module

```
npm install --save-dev sl-test-helpers
```

## If running Synchronous tests, such as Unit Tests

For each test helper you wish to use, you will need to import them into each individual Unit Tests. For example:

```
import { contains } from '../../helpers/sl/synchronous';
```

## If running Asynchronous tests, such as Acceptance Tests

You only need to run the blueprint:

```
ember generate sl-test-helpers
```

If your application is under source control management, such as via Git, make sure to commit the changes made to the following files by the generator:

* tests/helpers/start-app.js
* tests/.jshintrc


The generator makes changes to the above files assuming the structure of them has not changed much from the default version created during the initial Ember application creation.  If too many changes have been made you will need to manually make the changes below:

* Add `import slregisterTestHelpers from './sl/register-test-helpers';` to the beginning of the *tests/helpers/start-app.js* file
* In the *tests/helpers/start-app.js* file, place `slregisterTestHelpers();` before the `App.injectTestHelpers` line
* Add `"contains",` to the `predef` section of the */tests/.jshintrc* file


---

# Versioning
Employs [Semantic Versioning 2.0.0](http://semver.org/)

---

# Contribution
[See CONTRIBUTING.md](CONTRIBUTING.md)

---

# Copyright and License
sl-test-helpers and its source files are Copyright © 2014 [SoftLayer Technologies, Inc.](http://www.softlayer.com/)
The software is [MIT Licensed](LICENSE.md)


---

# Warranty
This software is provided “as is” and without any express or implied warranties, including, without limitation, the
implied warranties of merchantability and fitness for a particular purpose.
{'fraction_non_alphanumeric': 0.10233281493001556, 'fraction_numerical': 0.0037325038880248835, 'mean_word_length': 4.271311475409836, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7669124', 'n_tokens_mistral': 1847, 'n_tokens_neox': 1805, 'n_words': 796}