forked from assemble/assemble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
is.js
69 lines (61 loc) · 2.06 KB
/
is.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
'use strict';
require('mocha');
var assert = require('assert');
var support = require('./support');
var App = support.resolve();
describe('is', function() {
describe('isApp', function() {
it('should return true if value is an instance of App', function() {
var app = new App();
assert(App.isApp(app));
});
it('should return false if value is not an instance of App', function() {
assert(!App.isApp('foo'));
});
});
describe('isCollection', function() {
it('should return true if value is an instance of Collection', function() {
var collection = new App.Collection();
assert(App.isCollection(collection));
});
it('should return false if value is not an instance of Collection', function() {
assert(!App.isCollection('foo'));
});
});
describe('isViews', function() {
it('should return true if value is an instance of Views', function() {
var collection = new App.Views();
assert(App.isViews(collection));
});
it('should return false if value is not an instance of Views', function() {
assert(!App.isViews('foo'));
});
});
describe('isList', function() {
it('should return true if value is an instance of List', function() {
var collection = new App.List();
assert(App.isList(collection));
});
it('should return false if value is not an instance of List', function() {
assert(!App.isList('foo'));
});
});
describe('isView', function() {
it('should return true if value is an instance of View', function() {
var collection = new App.View();
assert(App.isView(collection));
});
it('should return false if value is not an instance of View', function() {
assert(!App.isView('foo'));
});
});
describe('isItem', function() {
it('should return true if value is an instance of Item', function() {
var collection = new App.Item();
assert(App.isItem(collection));
});
it('should return false if value is not an instance of Item', function() {
assert(!App.isItem('foo'));
});
});
});