ende 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/component.json +2 -2
- data/components/component/bind/{0.0.1 → 1.0.0}/component.json +1 -1
- data/components/component/bind/{0.0.1 → 1.0.0}/index.js +1 -2
- data/components/component/jquery/1.0.0/component.json +10 -0
- data/components/component/jquery/1.0.0/index.js +10308 -0
- data/components/component/matches-selector/{0.1.2 → 0.1.4}/component.json +1 -1
- data/components/component/matches-selector/{0.1.2 → 0.1.4}/index.js +0 -0
- data/components/indefinido/advisable/master/component.json +1 -1
- data/components/indefinido/indemma/master/component.json +4 -7
- data/components/indefinido/indemma/master/lib/record.js +7 -2
- data/components/indefinido/indemma/master/lib/record/dirtyable.js +15 -6
- data/components/indefinido/indemma/master/lib/record/scopable.js +1 -1
- data/components/indefinido/observable/es6-modules/component.json +1 -1
- data/components/indefinido/observable/es6-modules/lib/legacy/schedulerable.js +8 -3
- data/components/indefinido/observable/es6-modules/lib/observable.js +0 -1
- data/components/indefinido/observable/es6-modules/lib/observable/observation.js +2 -2
- data/components/paulmillr/es6-shim/{0.10.1 → 0.14.0}/component.json +1 -1
- data/components/paulmillr/es6-shim/{0.10.1 → 0.14.0}/es6-shim.js +151 -102
- data/components/pluma/assimilate/{0.3.0 → 0.4.0}/component.json +2 -2
- data/components/pluma/assimilate/{0.3.0 → 0.4.0}/dist/assimilate.js +1 -1
- data/lib/assets/javascripts/aura/extensions/rivets.js.coffee +12 -6
- data/lib/assets/javascripts/config/load_components.js.coffee +1 -1
- data/lib/assets/javascripts/ende.js.coffee +1 -1
- data/lib/ende/version.rb +1 -1
- data/vendor/assets/component/build.css +112 -0
- data/vendor/assets/components/ende_build.js +20357 -19584
- metadata +13 -84
- data/components/chaijs/assertion-error/1.0.0/component.json +0 -18
- data/components/chaijs/assertion-error/1.0.0/index.js +0 -110
- data/components/chaijs/chai/1.9.1/.gitignore +0 -22
- data/components/chaijs/chai/1.9.1/.mailmap +0 -1
- data/components/chaijs/chai/1.9.1/.npmignore +0 -14
- data/components/chaijs/chai/1.9.1/.travis.yml +0 -14
- data/components/chaijs/chai/1.9.1/CONTRIBUTING.md +0 -173
- data/components/chaijs/chai/1.9.1/History.md +0 -895
- data/components/chaijs/chai/1.9.1/Makefile +0 -93
- data/components/chaijs/chai/1.9.1/README.md +0 -99
- data/components/chaijs/chai/1.9.1/ReleaseNotes.md +0 -482
- data/components/chaijs/chai/1.9.1/bower.json +0 -27
- data/components/chaijs/chai/1.9.1/chai.js +0 -4782
- data/components/chaijs/chai/1.9.1/component.json +0 -50
- data/components/chaijs/chai/1.9.1/index.js +0 -1
- data/components/chaijs/chai/1.9.1/karma.conf.js +0 -28
- data/components/chaijs/chai/1.9.1/karma.sauce.js +0 -41
- data/components/chaijs/chai/1.9.1/lib/chai.js +0 -87
- data/components/chaijs/chai/1.9.1/lib/chai/assertion.js +0 -130
- data/components/chaijs/chai/1.9.1/lib/chai/config.js +0 -50
- data/components/chaijs/chai/1.9.1/lib/chai/core/assertions.js +0 -1314
- data/components/chaijs/chai/1.9.1/lib/chai/interface/assert.js +0 -1056
- data/components/chaijs/chai/1.9.1/lib/chai/interface/expect.js +0 -12
- data/components/chaijs/chai/1.9.1/lib/chai/interface/should.js +0 -78
- data/components/chaijs/chai/1.9.1/lib/chai/utils/addChainableMethod.js +0 -111
- data/components/chaijs/chai/1.9.1/lib/chai/utils/addMethod.js +0 -43
- data/components/chaijs/chai/1.9.1/lib/chai/utils/addProperty.js +0 -40
- data/components/chaijs/chai/1.9.1/lib/chai/utils/flag.js +0 -32
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getActual.js +0 -18
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getEnumerableProperties.js +0 -25
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getMessage.js +0 -49
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getName.js +0 -20
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getPathValue.js +0 -102
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getProperties.js +0 -35
- data/components/chaijs/chai/1.9.1/lib/chai/utils/index.js +0 -114
- data/components/chaijs/chai/1.9.1/lib/chai/utils/inspect.js +0 -320
- data/components/chaijs/chai/1.9.1/lib/chai/utils/objDisplay.js +0 -49
- data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteChainableMethod.js +0 -53
- data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteMethod.js +0 -51
- data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteProperty.js +0 -54
- data/components/chaijs/chai/1.9.1/lib/chai/utils/test.js +0 -26
- data/components/chaijs/chai/1.9.1/lib/chai/utils/transferFlags.js +0 -44
- data/components/chaijs/chai/1.9.1/lib/chai/utils/type.js +0 -45
- data/components/chaijs/chai/1.9.1/package.json +0 -42
- data/components/chaijs/chai/1.9.1/sauce.browsers.js +0 -128
- data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_block.sh +0 -7
- data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_setup.sh +0 -53
- data/components/chaijs/chai/1.9.1/test/assert.js +0 -638
- data/components/chaijs/chai/1.9.1/test/auth/.gitkeep +0 -0
- data/components/chaijs/chai/1.9.1/test/bootstrap/index.js +0 -22
- data/components/chaijs/chai/1.9.1/test/bootstrap/karma.js +0 -22
- data/components/chaijs/chai/1.9.1/test/configuration.js +0 -133
- data/components/chaijs/chai/1.9.1/test/display/errors.js +0 -14
- data/components/chaijs/chai/1.9.1/test/display/message.js +0 -47
- data/components/chaijs/chai/1.9.1/test/expect.js +0 -814
- data/components/chaijs/chai/1.9.1/test/globalShould.js +0 -15
- data/components/chaijs/chai/1.9.1/test/plugins.js +0 -24
- data/components/chaijs/chai/1.9.1/test/should.js +0 -744
- data/components/chaijs/chai/1.9.1/test/utilities.js +0 -309
- data/components/chaijs/deep-eql/0.1.3/component.json +0 -20
- data/components/chaijs/deep-eql/0.1.3/lib/eql.js +0 -257
- data/components/chaijs/type-detect/0.1.1/component.json +0 -18
- data/components/chaijs/type-detect/0.1.1/lib/type.js +0 -142
- data/components/component/classes/1.2.1/component.json +0 -19
- data/components/component/classes/1.2.1/index.js +0 -184
- data/components/component/domify/1.2.2/component.json +0 -22
- data/components/component/domify/1.2.2/index.js +0 -87
- data/components/component/event/0.1.3/component.json +0 -13
- data/components/component/event/0.1.3/index.js +0 -35
- data/components/component/jquery/1.9.1/component.json +0 -14
- data/components/component/jquery/1.9.1/index.js +0 -9601
- data/components/component/query/0.0.3/component.json +0 -23
- data/components/component/query/0.0.3/index.js +0 -21
- data/lib/tasks/.gitkeep +0 -0
@@ -1,53 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
set -e
|
4
|
-
|
5
|
-
# Setup and start Sauce Connect for your TravisCI build
|
6
|
-
# This script requires your .travis.yml to include the following two private env variables:
|
7
|
-
# SAUCE_USERNAME
|
8
|
-
# SAUCE_ACCESS_KEY
|
9
|
-
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
|
10
|
-
#
|
11
|
-
# Curl and run this script as part of your .travis.yml before_script section:
|
12
|
-
# before_script:
|
13
|
-
# - curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash
|
14
|
-
|
15
|
-
CONNECT_URL="http://saucelabs.com/downloads/Sauce-Connect-latest.zip"
|
16
|
-
CONNECT_DIR="/tmp/sauce-connect-$RANDOM"
|
17
|
-
CONNECT_DOWNLOAD="Sauce_Connect.zip"
|
18
|
-
|
19
|
-
mkdir -p $LOGS_DIR
|
20
|
-
CONNECT_LOG="$LOGS_DIR/sauce-connect"
|
21
|
-
CONNECT_STDOUT="$LOGS_DIR/sauce-connect.stdout"
|
22
|
-
CONNECT_STDERR="$LOGS_DIR/sauce-connect.stderr"
|
23
|
-
|
24
|
-
# Get Connect and start it
|
25
|
-
mkdir -p $CONNECT_DIR
|
26
|
-
cd $CONNECT_DIR
|
27
|
-
curl $CONNECT_URL -o $CONNECT_DOWNLOAD 2> /dev/null 1> /dev/null
|
28
|
-
unzip $CONNECT_DOWNLOAD > /dev/null
|
29
|
-
rm $CONNECT_DOWNLOAD
|
30
|
-
|
31
|
-
SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`
|
32
|
-
|
33
|
-
|
34
|
-
ARGS=""
|
35
|
-
|
36
|
-
# Set tunnel-id only on Travis, to make local testing easier.
|
37
|
-
if [ ! -z "$TRAVIS_JOB_NUMBER" ]; then
|
38
|
-
ARGS="$ARGS --tunnel-identifier $TRAVIS_JOB_NUMBER"
|
39
|
-
fi
|
40
|
-
if [ ! -z "$SAUCE_CONNECT_READY_FILE" ]; then
|
41
|
-
ARGS="$ARGS --readyfile $SAUCE_CONNECT_READY_FILE"
|
42
|
-
fi
|
43
|
-
|
44
|
-
echo "Starting Sauce Connect in the background:"
|
45
|
-
echo " Arg: $ARGS"
|
46
|
-
echo "Logging into:"
|
47
|
-
echo " Log: $CONNECT_LOG"
|
48
|
-
echo " Out: $CONNECT_STDOUT"
|
49
|
-
echo " Err: $CONNECT_STDERR"
|
50
|
-
java -jar Sauce-Connect.jar $ARGS $SAUCE_USERNAME $SAUCE_ACCESS_KEY \
|
51
|
-
--logfile $CONNECT_LOG 2> $CONNECT_STDERR 1> $CONNECT_STDOUT &
|
52
|
-
CONNECT_PID=$!
|
53
|
-
echo " Pid: $CONNECT_PID"
|
@@ -1,638 +0,0 @@
|
|
1
|
-
describe('assert', function () {
|
2
|
-
var assert = chai.assert;
|
3
|
-
|
4
|
-
it('assert', function () {
|
5
|
-
var foo = 'bar';
|
6
|
-
assert(foo == 'bar', "expected foo to equal `bar`");
|
7
|
-
|
8
|
-
err(function () {
|
9
|
-
assert(foo == 'baz', "expected foo to equal `bar`");
|
10
|
-
}, "expected foo to equal `bar`");
|
11
|
-
});
|
12
|
-
|
13
|
-
it('fail', function () {
|
14
|
-
chai.expect(function () {
|
15
|
-
assert.fail(0, 1, 'this has failed');
|
16
|
-
}).to.throw(chai.AssertionError, /this has failed/);
|
17
|
-
});
|
18
|
-
|
19
|
-
it('isTrue', function () {
|
20
|
-
assert.isTrue(true);
|
21
|
-
|
22
|
-
err(function() {
|
23
|
-
assert.isTrue(false);
|
24
|
-
}, "expected false to be true");
|
25
|
-
|
26
|
-
err(function() {
|
27
|
-
assert.isTrue(1);
|
28
|
-
}, "expected 1 to be true");
|
29
|
-
|
30
|
-
err(function() {
|
31
|
-
assert.isTrue('test');
|
32
|
-
}, "expected 'test' to be true");
|
33
|
-
});
|
34
|
-
|
35
|
-
it('ok', function () {
|
36
|
-
assert.ok(true);
|
37
|
-
assert.ok(1);
|
38
|
-
assert.ok('test');
|
39
|
-
|
40
|
-
err(function () {
|
41
|
-
assert.ok(false);
|
42
|
-
}, "expected false to be truthy");
|
43
|
-
|
44
|
-
err(function () {
|
45
|
-
assert.ok(0);
|
46
|
-
}, "expected 0 to be truthy");
|
47
|
-
|
48
|
-
err(function () {
|
49
|
-
assert.ok('');
|
50
|
-
}, "expected '' to be truthy");
|
51
|
-
});
|
52
|
-
|
53
|
-
it('notOk', function () {
|
54
|
-
assert.notOk(false);
|
55
|
-
assert.notOk(0);
|
56
|
-
assert.notOk('');
|
57
|
-
|
58
|
-
err(function () {
|
59
|
-
assert.notOk(true);
|
60
|
-
}, "expected true to be falsy");
|
61
|
-
|
62
|
-
err(function () {
|
63
|
-
assert.notOk(1);
|
64
|
-
}, "expected 1 to be falsy");
|
65
|
-
|
66
|
-
err(function () {
|
67
|
-
assert.notOk('test');
|
68
|
-
}, "expected 'test' to be falsy");
|
69
|
-
});
|
70
|
-
|
71
|
-
it('isFalse', function () {
|
72
|
-
assert.isFalse(false);
|
73
|
-
|
74
|
-
err(function() {
|
75
|
-
assert.isFalse(true);
|
76
|
-
}, "expected true to be false");
|
77
|
-
|
78
|
-
err(function() {
|
79
|
-
assert.isFalse(0);
|
80
|
-
}, "expected 0 to be false");
|
81
|
-
});
|
82
|
-
|
83
|
-
it('equal', function () {
|
84
|
-
var foo;
|
85
|
-
assert.equal(foo, undefined);
|
86
|
-
});
|
87
|
-
|
88
|
-
it('typeof / notTypeOf', function () {
|
89
|
-
assert.typeOf('test', 'string');
|
90
|
-
assert.typeOf(true, 'boolean');
|
91
|
-
assert.typeOf(5, 'number');
|
92
|
-
|
93
|
-
err(function () {
|
94
|
-
assert.typeOf(5, 'string');
|
95
|
-
}, "expected 5 to be a string");
|
96
|
-
|
97
|
-
});
|
98
|
-
|
99
|
-
it('notTypeOf', function () {
|
100
|
-
assert.notTypeOf('test', 'number');
|
101
|
-
|
102
|
-
err(function () {
|
103
|
-
assert.notTypeOf(5, 'number');
|
104
|
-
}, "expected 5 not to be a number");
|
105
|
-
});
|
106
|
-
|
107
|
-
it('instanceOf', function() {
|
108
|
-
function Foo(){}
|
109
|
-
assert.instanceOf(new Foo(), Foo);
|
110
|
-
|
111
|
-
err(function () {
|
112
|
-
assert.instanceOf(5, Foo);
|
113
|
-
}, "expected 5 to be an instance of Foo");
|
114
|
-
|
115
|
-
function CrashyObject() {};
|
116
|
-
CrashyObject.prototype.inspect = function () {
|
117
|
-
throw new Error("Arg's inspect() called even though the test passed");
|
118
|
-
};
|
119
|
-
assert.instanceOf(new CrashyObject(), CrashyObject);
|
120
|
-
});
|
121
|
-
|
122
|
-
it('notInstanceOf', function () {
|
123
|
-
function Foo(){}
|
124
|
-
assert.notInstanceOf(new Foo(), String);
|
125
|
-
|
126
|
-
err(function () {
|
127
|
-
assert.notInstanceOf(new Foo(), Foo);
|
128
|
-
}, "expected {} to not be an instance of Foo");
|
129
|
-
});
|
130
|
-
|
131
|
-
it('isObject', function () {
|
132
|
-
function Foo(){}
|
133
|
-
assert.isObject({});
|
134
|
-
assert.isObject(new Foo());
|
135
|
-
|
136
|
-
err(function() {
|
137
|
-
assert.isObject(true);
|
138
|
-
}, "expected true to be an object");
|
139
|
-
|
140
|
-
err(function() {
|
141
|
-
assert.isObject(Foo);
|
142
|
-
}, "expected [Function: Foo] to be an object");
|
143
|
-
|
144
|
-
err(function() {
|
145
|
-
assert.isObject('foo');
|
146
|
-
}, "expected 'foo' to be an object");
|
147
|
-
});
|
148
|
-
|
149
|
-
it('isNotObject', function () {
|
150
|
-
function Foo(){}
|
151
|
-
assert.isNotObject(5);
|
152
|
-
|
153
|
-
err(function() {
|
154
|
-
assert.isNotObject({});
|
155
|
-
}, "expected {} not to be an object");
|
156
|
-
});
|
157
|
-
|
158
|
-
it('notEqual', function() {
|
159
|
-
assert.notEqual(3, 4);
|
160
|
-
|
161
|
-
err(function () {
|
162
|
-
assert.notEqual(5, 5);
|
163
|
-
}, "expected 5 to not equal 5");
|
164
|
-
});
|
165
|
-
|
166
|
-
it('strictEqual', function() {
|
167
|
-
assert.strictEqual('foo', 'foo');
|
168
|
-
|
169
|
-
err(function () {
|
170
|
-
assert.strictEqual('5', 5);
|
171
|
-
}, "expected \'5\' to equal 5");
|
172
|
-
});
|
173
|
-
|
174
|
-
it('notStrictEqual', function() {
|
175
|
-
assert.notStrictEqual(5, '5');
|
176
|
-
|
177
|
-
err(function () {
|
178
|
-
assert.notStrictEqual(5, 5);
|
179
|
-
}, "expected 5 to not equal 5");
|
180
|
-
});
|
181
|
-
|
182
|
-
it('deepEqual', function() {
|
183
|
-
assert.deepEqual({tea: 'chai'}, {tea: 'chai'});
|
184
|
-
|
185
|
-
err(function () {
|
186
|
-
assert.deepEqual({tea: 'chai'}, {tea: 'black'});
|
187
|
-
}, "expected { tea: \'chai\' } to deeply equal { tea: \'black\' }");
|
188
|
-
|
189
|
-
var obja = Object.create({ tea: 'chai' })
|
190
|
-
, objb = Object.create({ tea: 'chai' });
|
191
|
-
|
192
|
-
assert.deepEqual(obja, objb);
|
193
|
-
|
194
|
-
var obj1 = Object.create({tea: 'chai'})
|
195
|
-
, obj2 = Object.create({tea: 'black'});
|
196
|
-
|
197
|
-
err(function () {
|
198
|
-
assert.deepEqual(obj1, obj2);
|
199
|
-
}, "expected { tea: \'chai\' } to deeply equal { tea: \'black\' }");
|
200
|
-
});
|
201
|
-
|
202
|
-
it('deepEqual (ordering)', function() {
|
203
|
-
var a = { a: 'b', c: 'd' }
|
204
|
-
, b = { c: 'd', a: 'b' };
|
205
|
-
assert.deepEqual(a, b);
|
206
|
-
});
|
207
|
-
|
208
|
-
it('deepEqual /regexp/', function() {
|
209
|
-
assert.deepEqual(/a/, /a/);
|
210
|
-
assert.notDeepEqual(/a/, /b/);
|
211
|
-
assert.notDeepEqual(/a/, {});
|
212
|
-
assert.deepEqual(/a/g, /a/g);
|
213
|
-
assert.notDeepEqual(/a/g, /b/g);
|
214
|
-
assert.deepEqual(/a/i, /a/i);
|
215
|
-
assert.notDeepEqual(/a/i, /b/i);
|
216
|
-
assert.deepEqual(/a/m, /a/m);
|
217
|
-
assert.notDeepEqual(/a/m, /b/m);
|
218
|
-
});
|
219
|
-
|
220
|
-
it('deepEqual (Date)', function() {
|
221
|
-
var a = new Date(1, 2, 3)
|
222
|
-
, b = new Date(4, 5, 6);
|
223
|
-
assert.deepEqual(a, a);
|
224
|
-
assert.notDeepEqual(a, b);
|
225
|
-
assert.notDeepEqual(a, {});
|
226
|
-
});
|
227
|
-
|
228
|
-
it('deepEqual (circular)', function() {
|
229
|
-
var circularObject = {}
|
230
|
-
, secondCircularObject = {};
|
231
|
-
circularObject.field = circularObject;
|
232
|
-
secondCircularObject.field = secondCircularObject;
|
233
|
-
|
234
|
-
assert.deepEqual(circularObject, secondCircularObject);
|
235
|
-
|
236
|
-
err(function() {
|
237
|
-
secondCircularObject.field2 = secondCircularObject;
|
238
|
-
assert.deepEqual(circularObject, secondCircularObject);
|
239
|
-
}, "expected { field: [Circular] } to deeply equal { Object (field, field2) }");
|
240
|
-
});
|
241
|
-
|
242
|
-
it('notDeepEqual', function() {
|
243
|
-
assert.notDeepEqual({tea: 'jasmine'}, {tea: 'chai'});
|
244
|
-
|
245
|
-
err(function () {
|
246
|
-
assert.notDeepEqual({tea: 'chai'}, {tea: 'chai'});
|
247
|
-
}, "expected { tea: \'chai\' } to not deeply equal { tea: \'chai\' }");
|
248
|
-
});
|
249
|
-
|
250
|
-
it('notDeepEqual (circular)', function() {
|
251
|
-
var circularObject = {}
|
252
|
-
, secondCircularObject = { tea: 'jasmine' };
|
253
|
-
circularObject.field = circularObject;
|
254
|
-
secondCircularObject.field = secondCircularObject;
|
255
|
-
|
256
|
-
assert.notDeepEqual(circularObject, secondCircularObject);
|
257
|
-
|
258
|
-
err(function() {
|
259
|
-
delete secondCircularObject.tea;
|
260
|
-
assert.notDeepEqual(circularObject, secondCircularObject);
|
261
|
-
}, "expected { field: [Circular] } to not deeply equal { field: [Circular] }");
|
262
|
-
});
|
263
|
-
|
264
|
-
it('isNull', function() {
|
265
|
-
assert.isNull(null);
|
266
|
-
|
267
|
-
err(function () {
|
268
|
-
assert.isNull(undefined);
|
269
|
-
}, "expected undefined to equal null");
|
270
|
-
});
|
271
|
-
|
272
|
-
it('isNotNull', function() {
|
273
|
-
assert.isNotNull(undefined);
|
274
|
-
|
275
|
-
err(function () {
|
276
|
-
assert.isNotNull(null);
|
277
|
-
}, "expected null to not equal null");
|
278
|
-
});
|
279
|
-
|
280
|
-
it('isUndefined', function() {
|
281
|
-
assert.isUndefined(undefined);
|
282
|
-
|
283
|
-
err(function () {
|
284
|
-
assert.isUndefined(null);
|
285
|
-
}, "expected null to equal undefined");
|
286
|
-
});
|
287
|
-
|
288
|
-
it('isDefined', function() {
|
289
|
-
assert.isDefined(null);
|
290
|
-
|
291
|
-
err(function () {
|
292
|
-
assert.isDefined(undefined);
|
293
|
-
}, "expected undefined to not equal undefined");
|
294
|
-
});
|
295
|
-
|
296
|
-
it('isFunction', function() {
|
297
|
-
var func = function() {};
|
298
|
-
assert.isFunction(func);
|
299
|
-
|
300
|
-
err(function () {
|
301
|
-
assert.isFunction({});
|
302
|
-
}, "expected {} to be a function");
|
303
|
-
});
|
304
|
-
|
305
|
-
it('isNotFunction', function () {
|
306
|
-
assert.isNotFunction(5);
|
307
|
-
|
308
|
-
err(function () {
|
309
|
-
assert.isNotFunction(function () {});
|
310
|
-
}, "expected [Function] not to be a function");
|
311
|
-
});
|
312
|
-
|
313
|
-
it('isArray', function() {
|
314
|
-
assert.isArray([]);
|
315
|
-
assert.isArray(new Array);
|
316
|
-
|
317
|
-
err(function () {
|
318
|
-
assert.isArray({});
|
319
|
-
}, "expected {} to be an array");
|
320
|
-
});
|
321
|
-
|
322
|
-
it('isNotArray', function () {
|
323
|
-
assert.isNotArray(3);
|
324
|
-
|
325
|
-
err(function () {
|
326
|
-
assert.isNotArray([]);
|
327
|
-
}, "expected [] not to be an array");
|
328
|
-
|
329
|
-
err(function () {
|
330
|
-
assert.isNotArray(new Array);
|
331
|
-
}, "expected [] not to be an array");
|
332
|
-
});
|
333
|
-
|
334
|
-
it('isString', function() {
|
335
|
-
assert.isString('Foo');
|
336
|
-
assert.isString(new String('foo'));
|
337
|
-
|
338
|
-
err(function () {
|
339
|
-
assert.isString(1);
|
340
|
-
}, "expected 1 to be a string");
|
341
|
-
});
|
342
|
-
|
343
|
-
it('isNotString', function () {
|
344
|
-
assert.isNotString(3);
|
345
|
-
assert.isNotString([ 'hello' ]);
|
346
|
-
|
347
|
-
err(function () {
|
348
|
-
assert.isNotString('hello');
|
349
|
-
}, "expected 'hello' not to be a string");
|
350
|
-
});
|
351
|
-
|
352
|
-
it('isNumber', function() {
|
353
|
-
assert.isNumber(1);
|
354
|
-
assert.isNumber(Number('3'));
|
355
|
-
|
356
|
-
err(function () {
|
357
|
-
assert.isNumber('1');
|
358
|
-
}, "expected \'1\' to be a number");
|
359
|
-
});
|
360
|
-
|
361
|
-
it('isNotNumber', function () {
|
362
|
-
assert.isNotNumber('hello');
|
363
|
-
assert.isNotNumber([ 5 ]);
|
364
|
-
|
365
|
-
err(function () {
|
366
|
-
assert.isNotNumber(4);
|
367
|
-
}, "expected 4 not to be a number");
|
368
|
-
});
|
369
|
-
|
370
|
-
it('isBoolean', function() {
|
371
|
-
assert.isBoolean(true);
|
372
|
-
assert.isBoolean(false);
|
373
|
-
|
374
|
-
err(function () {
|
375
|
-
assert.isBoolean('1');
|
376
|
-
}, "expected \'1\' to be a boolean");
|
377
|
-
});
|
378
|
-
|
379
|
-
it('isNotBoolean', function () {
|
380
|
-
assert.isNotBoolean('true');
|
381
|
-
|
382
|
-
err(function () {
|
383
|
-
assert.isNotBoolean(true);
|
384
|
-
}, "expected true not to be a boolean");
|
385
|
-
|
386
|
-
err(function () {
|
387
|
-
assert.isNotBoolean(false);
|
388
|
-
}, "expected false not to be a boolean");
|
389
|
-
});
|
390
|
-
|
391
|
-
it('include', function() {
|
392
|
-
assert.include('foobar', 'bar');
|
393
|
-
assert.include([ 1, 2, 3], 3);
|
394
|
-
assert.include({a:1, b:2}, {b:2});
|
395
|
-
|
396
|
-
err(function () {
|
397
|
-
assert.include('foobar', 'baz');
|
398
|
-
}, "expected \'foobar\' to include \'baz\'");
|
399
|
-
|
400
|
-
err(function () {
|
401
|
-
assert.include(undefined, 'bar');
|
402
|
-
}, "expected undefined to include 'bar'");
|
403
|
-
});
|
404
|
-
|
405
|
-
it('notInclude', function () {
|
406
|
-
assert.notInclude('foobar', 'baz');
|
407
|
-
assert.notInclude([ 1, 2, 3 ], 4);
|
408
|
-
assert.notInclude(undefined, 'bar');
|
409
|
-
|
410
|
-
err(function () {
|
411
|
-
assert.notInclude('foobar', 'bar');
|
412
|
-
}, "expected \'foobar\' to not include \'bar\'");
|
413
|
-
});
|
414
|
-
|
415
|
-
it('lengthOf', function() {
|
416
|
-
assert.lengthOf([1,2,3], 3);
|
417
|
-
assert.lengthOf('foobar', 6);
|
418
|
-
|
419
|
-
err(function () {
|
420
|
-
assert.lengthOf('foobar', 5);
|
421
|
-
}, "expected 'foobar' to have a length of 5 but got 6");
|
422
|
-
|
423
|
-
err(function () {
|
424
|
-
assert.lengthOf(1, 5);
|
425
|
-
}, "expected 1 to have a property \'length\'");
|
426
|
-
});
|
427
|
-
|
428
|
-
it('match', function () {
|
429
|
-
assert.match('foobar', /^foo/);
|
430
|
-
assert.notMatch('foobar', /^bar/);
|
431
|
-
|
432
|
-
err(function () {
|
433
|
-
assert.match('foobar', /^bar/i);
|
434
|
-
}, "expected 'foobar' to match /^bar/i");
|
435
|
-
|
436
|
-
err(function () {
|
437
|
-
assert.notMatch('foobar', /^foo/i);
|
438
|
-
}, "expected 'foobar' not to match /^foo/i");
|
439
|
-
});
|
440
|
-
|
441
|
-
it('property', function () {
|
442
|
-
var obj = { foo: { bar: 'baz' } };
|
443
|
-
var simpleObj = { foo: 'bar' };
|
444
|
-
assert.property(obj, 'foo');
|
445
|
-
assert.deepProperty(obj, 'foo.bar');
|
446
|
-
assert.notProperty(obj, 'baz');
|
447
|
-
assert.notProperty(obj, 'foo.bar');
|
448
|
-
assert.notDeepProperty(obj, 'foo.baz');
|
449
|
-
assert.deepPropertyVal(obj, 'foo.bar', 'baz');
|
450
|
-
assert.deepPropertyNotVal(obj, 'foo.bar', 'flow');
|
451
|
-
|
452
|
-
err(function () {
|
453
|
-
assert.property(obj, 'baz');
|
454
|
-
}, "expected { foo: { bar: 'baz' } } to have a property 'baz'");
|
455
|
-
|
456
|
-
err(function () {
|
457
|
-
assert.deepProperty(obj, 'foo.baz');
|
458
|
-
}, "expected { foo: { bar: 'baz' } } to have a deep property 'foo.baz'");
|
459
|
-
|
460
|
-
err(function () {
|
461
|
-
assert.notProperty(obj, 'foo');
|
462
|
-
}, "expected { foo: { bar: 'baz' } } to not have property 'foo'");
|
463
|
-
|
464
|
-
err(function () {
|
465
|
-
assert.notDeepProperty(obj, 'foo.bar');
|
466
|
-
}, "expected { foo: { bar: 'baz' } } to not have deep property 'foo.bar'");
|
467
|
-
|
468
|
-
err(function () {
|
469
|
-
assert.propertyVal(simpleObj, 'foo', 'ball');
|
470
|
-
}, "expected { foo: 'bar' } to have a property 'foo' of 'ball', but got 'bar'");
|
471
|
-
|
472
|
-
err(function () {
|
473
|
-
assert.deepPropertyVal(obj, 'foo.bar', 'ball');
|
474
|
-
}, "expected { foo: { bar: 'baz' } } to have a deep property 'foo.bar' of 'ball', but got 'baz'");
|
475
|
-
|
476
|
-
err(function () {
|
477
|
-
assert.propertyNotVal(simpleObj, 'foo', 'bar');
|
478
|
-
}, "expected { foo: 'bar' } to not have a property 'foo' of 'bar'");
|
479
|
-
|
480
|
-
err(function () {
|
481
|
-
assert.deepPropertyNotVal(obj, 'foo.bar', 'baz');
|
482
|
-
}, "expected { foo: { bar: 'baz' } } to not have a deep property 'foo.bar' of 'baz'");
|
483
|
-
});
|
484
|
-
|
485
|
-
it('throws', function() {
|
486
|
-
assert.throws(function() { throw new Error('foo'); });
|
487
|
-
assert.throws(function() { throw new Error('bar'); }, 'bar');
|
488
|
-
assert.throws(function() { throw new Error('bar'); }, /bar/);
|
489
|
-
assert.throws(function() { throw new Error('bar'); }, Error);
|
490
|
-
assert.throws(function() { throw new Error('bar'); }, Error, 'bar');
|
491
|
-
|
492
|
-
var thrownErr = assert.throws(function() { throw new Error('foo'); });
|
493
|
-
assert(thrownErr instanceof Error, 'assert.throws returns error');
|
494
|
-
assert(thrownErr.message === 'foo', 'assert.throws returns error message');
|
495
|
-
|
496
|
-
err(function () {
|
497
|
-
assert.throws(function() { throw new Error('foo') }, TypeError);
|
498
|
-
}, "expected [Function] to throw 'TypeError' but 'Error: foo' was thrown")
|
499
|
-
|
500
|
-
err(function () {
|
501
|
-
assert.throws(function() { throw new Error('foo') }, 'bar');
|
502
|
-
}, "expected [Function] to throw error including 'bar' but got 'foo'")
|
503
|
-
|
504
|
-
err(function () {
|
505
|
-
assert.throws(function() { throw new Error('foo') }, Error, 'bar');
|
506
|
-
}, "expected [Function] to throw error including 'bar' but got 'foo'")
|
507
|
-
|
508
|
-
err(function () {
|
509
|
-
assert.throws(function() { throw new Error('foo') }, TypeError, 'bar');
|
510
|
-
}, "expected [Function] to throw 'TypeError' but 'Error: foo' was thrown")
|
511
|
-
|
512
|
-
err(function () {
|
513
|
-
assert.throws(function() {});
|
514
|
-
}, "expected [Function] to throw an error");
|
515
|
-
|
516
|
-
err(function () {
|
517
|
-
assert.throws(function() { throw new Error('') }, 'bar');
|
518
|
-
}, "expected [Function] to throw error including 'bar' but got ''");
|
519
|
-
|
520
|
-
err(function () {
|
521
|
-
assert.throws(function() { throw new Error('') }, /bar/);
|
522
|
-
}, "expected [Function] to throw error matching /bar/ but got ''");
|
523
|
-
});
|
524
|
-
|
525
|
-
it('doesNotThrow', function() {
|
526
|
-
function CustomError(message) {
|
527
|
-
this.name = 'CustomError';
|
528
|
-
this.message = message;
|
529
|
-
}
|
530
|
-
CustomError.prototype = Error.prototype;
|
531
|
-
|
532
|
-
assert.doesNotThrow(function() { });
|
533
|
-
assert.doesNotThrow(function() { }, 'foo');
|
534
|
-
|
535
|
-
err(function () {
|
536
|
-
assert.doesNotThrow(function() { throw new Error('foo'); });
|
537
|
-
}, "expected [Function] to not throw an error but 'Error: foo' was thrown");
|
538
|
-
|
539
|
-
err(function () {
|
540
|
-
assert.doesNotThrow(function() { throw new CustomError('foo'); });
|
541
|
-
}, "expected [Function] to not throw an error but 'CustomError: foo' was thrown");
|
542
|
-
});
|
543
|
-
|
544
|
-
it('ifError', function() {
|
545
|
-
assert.ifError(false);
|
546
|
-
assert.ifError(null);
|
547
|
-
assert.ifError(undefined);
|
548
|
-
|
549
|
-
err(function () {
|
550
|
-
assert.ifError('foo');
|
551
|
-
}, "expected \'foo\' to be falsy");
|
552
|
-
});
|
553
|
-
|
554
|
-
it('operator', function() {
|
555
|
-
assert.operator(1, '<', 2);
|
556
|
-
assert.operator(2, '>', 1);
|
557
|
-
assert.operator(1, '==', 1);
|
558
|
-
assert.operator(1, '<=', 1);
|
559
|
-
assert.operator(1, '>=', 1);
|
560
|
-
assert.operator(1, '!=', 2);
|
561
|
-
assert.operator(1, '!==', 2);
|
562
|
-
|
563
|
-
err(function () {
|
564
|
-
assert.operator(1, '=', 2);
|
565
|
-
}, 'Invalid operator "="');
|
566
|
-
|
567
|
-
err(function () {
|
568
|
-
assert.operator(2, '<', 1);
|
569
|
-
}, "expected 2 to be < 1");
|
570
|
-
|
571
|
-
err(function () {
|
572
|
-
assert.operator(1, '>', 2);
|
573
|
-
}, "expected 1 to be > 2");
|
574
|
-
|
575
|
-
err(function () {
|
576
|
-
assert.operator(1, '==', 2);
|
577
|
-
}, "expected 1 to be == 2");
|
578
|
-
|
579
|
-
err(function () {
|
580
|
-
assert.operator(2, '<=', 1);
|
581
|
-
}, "expected 2 to be <= 1");
|
582
|
-
|
583
|
-
err(function () {
|
584
|
-
assert.operator(1, '>=', 2);
|
585
|
-
}, "expected 1 to be >= 2");
|
586
|
-
|
587
|
-
err(function () {
|
588
|
-
assert.operator(1, '!=', 1);
|
589
|
-
}, "expected 1 to be != 1");
|
590
|
-
|
591
|
-
err(function () {
|
592
|
-
assert.operator(1, '!==', '1');
|
593
|
-
}, "expected 1 to be !== \'1\'");
|
594
|
-
});
|
595
|
-
|
596
|
-
it('closeTo', function(){
|
597
|
-
assert.closeTo(1.5, 1.0, 0.5);
|
598
|
-
assert.closeTo(10, 20, 20);
|
599
|
-
assert.closeTo(-10, 20, 30);
|
600
|
-
|
601
|
-
err(function(){
|
602
|
-
assert.closeTo(2, 1.0, 0.5);
|
603
|
-
}, "expected 2 to be close to 1 +/- 0.5");
|
604
|
-
|
605
|
-
err(function(){
|
606
|
-
assert.closeTo(-10, 20, 29);
|
607
|
-
}, "expected -10 to be close to 20 +/- 29");
|
608
|
-
});
|
609
|
-
|
610
|
-
it('members', function() {
|
611
|
-
assert.includeMembers([1, 2, 3], [2, 3]);
|
612
|
-
assert.includeMembers([1, 2, 3], []);
|
613
|
-
assert.includeMembers([1, 2, 3], [3]);
|
614
|
-
|
615
|
-
err(function() {
|
616
|
-
assert.includeMembers([5, 6], [7, 8]);
|
617
|
-
}, 'expected [ 5, 6 ] to be a superset of [ 7, 8 ]');
|
618
|
-
|
619
|
-
err(function() {
|
620
|
-
assert.includeMembers([5, 6], [5, 6, 0]);
|
621
|
-
}, 'expected [ 5, 6 ] to be a superset of [ 5, 6, 0 ]');
|
622
|
-
});
|
623
|
-
|
624
|
-
it('memberEquals', function() {
|
625
|
-
assert.sameMembers([], []);
|
626
|
-
assert.sameMembers([1, 2, 3], [3, 2, 1]);
|
627
|
-
assert.sameMembers([4, 2], [4, 2]);
|
628
|
-
|
629
|
-
err(function() {
|
630
|
-
assert.sameMembers([], [1, 2]);
|
631
|
-
}, 'expected [] to have the same members as [ 1, 2 ]');
|
632
|
-
|
633
|
-
err(function() {
|
634
|
-
assert.sameMembers([1, 54], [6, 1, 54]);
|
635
|
-
}, 'expected [ 1, 54 ] to have the same members as [ 6, 1, 54 ]');
|
636
|
-
});
|
637
|
-
|
638
|
-
});
|