API Docs for: 3.18.1
Show:

Features Class

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

Feature detection

Item Index

Methods

Properties

Methods

add

(
  • cat
  • name
  • o
)

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

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

Run a specific 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

Object hash of all registered feature tests