# 149MS

#### MS

# 6

#### Suites

# 8

#### Tests

# 8

#### Passed

# 0

#### Failed

# 0

#### Pending

0% Pending
100% Passing

### [core/utils/method] TEST

##### \src\js\core\utils\test\method.js

### #1 method() TEST

##### \src\js\core\utils\test\method.js

- 7 ms
- 1
- 1
- 0
- 0

#### Tests

#### it @1 `component` METHOD DEFINITION.

7 ms

    new method('component', {
        init: function(element, args) {
            var context = this;
            var local = context.local;
            var global = context.global;
            var options = local._options;

            try {
                assert.equal(local._id, 'component', 'COMPONENT LOCAL ID MUST BE `component`.');
            } catch(error) {
                return done(error);
            }
            try {
                assert.equal(local._init, true, 'COMPONENT LOCAL INIT MUST BE `true`.');
            } catch(error) {
                return done(error);
            }
            try {
                assert.equal(typeof local._prototype.init, 'function', 'COMPONENT LOCAL PROTOTYPE MUST HAVE `init` function.');
            } catch(error) {
                return done(error);
            }
            try {
                assert.equal(options.key, 'value', 'COMPONENT OPTIONS OF KEY MUST BE `value`.');
            } catch(error) {
                return done(error);
            }
            try {
                assert.deepEqual(options, $.extend(args, {
                    msg: 'Hello HOMEWORKS'
                }), 'COMPONENT LOCAL OPTIONS MATCH THE ARGUMENT THAT HOOK SAND.');
            } catch(error) {
                return done(error);
            }
            try {
                assert.equal(options.target.is($('#pen')), true, 'COMPONENT OPTIONS.target MUST BE `pen` element.');
            } catch(error) {
                return done(error);
            }
            try {
                assert.equal(options.msg, 'Hello HOMEWORKS', 'COMPONENT GLOBAL OPTION KEY `msg` MUST BE `Hello HOMEWORKS`.');
            } catch(error) {
                return done(error);
            }
            done();
        },
        options: {
            msg: 'Hello HOMEWORKS'
        }
    });
    (function(options) {
        var args = {
            target: options.target,
            key: 'value'
        };
        this.component(args);
    }).hook('component');

### [core/utils/prototype] TEST

##### \src\js\core\utils\test\prototype.js

### #1 String.prototype.mapping() TEST

##### \src\js\core\utils\test\prototype.js

- 0 ms
- 2
- 2
- 0
- 0

#### Tests

#### it @1 STRING MUST BE `Hello World`.

0 ms

    assert.equal('{hello} {world}'.mapping({
        hello: 'Hello',
        world: 'World'
    }), 'Hello World');

#### it @2 STRING MUST BE `I think Homeworks is better than most modern framework ever, So I think you have to use Homeworks right now!`.

0 ms

    assert.equal('I think {name} is better than most modern framework ever, So I think you have to use {name} {when}!'.mapping({
        name: 'Homeworks',
        when: 'right now'
    }), 'I think Homeworks is better than most modern framework ever, So I think you have to use Homeworks right now!');

### #2 String.prototype.format() TEST

##### \src\js\core\utils\test\prototype.js

- 0 ms
- 2
- 2
- 0
- 0

#### Tests

#### it @1 STRING MUST BE `Hello World`.

0 ms

    assert.equal('{0} {1}'.format(['Hello', 'World']), 'Hello World');

#### it @2 STRING MUST BE `Government of the people, by the people, for the people`.

0 ms

    assert.equal('{0} of the {1}, by the {1}, for the {1}'.format(['Government', 'people']), 'Government of the people, by the people, for the people');

### #3 Function.prototype.hook() TEST

##### \src\js\core\utils\test\prototype.js

- 4 ms
- 3
- 3
- 0
- 0

#### Tests

#### it @1 BINDED ELEMENT ID MUST BE `test`.

1 ms

    (function(options) {
        var elementID = this.attr('id');
        try {
            assert.equal(elementID, 'test');
        } catch(error) {
            return done(error);
        }
        done();
    }).hook('test');

#### it @2 TARGETED ELEMENT ID MUST BE `target`.

1 ms

    (function(options) {
        var targetID = options.target.attr('id');
        try {
            assert.equal(targetID, 'target');
        } catch(error) {
            return done(error);
        }
        done();
    }).hook('test');

#### it @3 BINDED VALUE MUST BE `true`.

2 ms

    (function(options) {
        try {
            assert.equal(options.value, true);
        } catch(error) {
            return done(error);
        }
        done();
    }).hook('test');