#

API Docs for: 3.10.3
Show: Inherited Protected Private Deprecated

# Features Class

Defined in: `yui/js/features.js:8`
Module: features

Feature detection

- Index
- Methods
- Properties

## Item Index

### Methods

- add
- all
- test

### Properties

- tests

## Methods

### `add`

(

- `cat`
- `name`
- `o`

)

Defined in `yui/js/features.js:23`

Add a test to the system

`Y.Features.add("load", "1", {});`

#### Parameters:

- `cat` String

  The category, right now only 'load' is supported

- `name` String

  The number sequence of the test, how it's reported in the URL or config: 1, 2, 3

- `o` Object

  Object containing test properties

  - `name` String

    The name of the test

  - `test` Function

    The test function to execute, the only argument to the function is the `Y` instance

  - `trigger` String

    The module that triggers this test.

### `all`

(

- `cat`
- `args`

)
String

Defined in `yui/js/features.js:42`

Execute all tests of a given category and return the serialized results

`caps=1:1;2:1;3:0`

#### Parameters:

- `cat` String

  The category to execute

- `args` Array

  The arguments to pass to the test function

#### Returns:

String: A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0

### `test`

(

- `cat`
- `name`
- `args`

)
Boolean

Defined in `yui/js/features.js:65`

Run a sepecific test and return a Boolean response.

`Y.Features.test("load", "1");`

#### Parameters:

- `cat` String

  The category of the test to run

- `name` String

  The name of the test to run

- `args` Array

  The arguments to pass to the test function

#### Returns:

Boolean: True or false if the test passed/failed.

## Properties

### `tests`

Object

Defined in `yui/js/features.js:16`

Object hash of all registered feature tests