jasmine-core 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jasmine-core/boot/node_boot.js +1 -1
- data/lib/jasmine-core/jasmine-html.js +0 -35
- data/lib/jasmine-core/jasmine.css +0 -6
- data/lib/jasmine-core/jasmine.js +246 -36
- data/lib/jasmine-core/node_boot.js +1 -1
- data/lib/jasmine-core/version.rb +1 -1
- metadata +3 -88
- data/lib/jasmine-core/spec/core/CallTrackerSpec.js +0 -130
- data/lib/jasmine-core/spec/core/ClearStackSpec.js +0 -137
- data/lib/jasmine-core/spec/core/ClockSpec.js +0 -710
- data/lib/jasmine-core/spec/core/DelayedFunctionSchedulerSpec.js +0 -286
- data/lib/jasmine-core/spec/core/EnvSpec.js +0 -200
- data/lib/jasmine-core/spec/core/ExceptionFormatterSpec.js +0 -120
- data/lib/jasmine-core/spec/core/ExceptionsSpec.js +0 -46
- data/lib/jasmine-core/spec/core/ExpectationResultSpec.js +0 -61
- data/lib/jasmine-core/spec/core/ExpectationSpec.js +0 -434
- data/lib/jasmine-core/spec/core/GlobalErrorsSpec.js +0 -110
- data/lib/jasmine-core/spec/core/JsApiReporterSpec.js +0 -259
- data/lib/jasmine-core/spec/core/MockDateSpec.js +0 -200
- data/lib/jasmine-core/spec/core/PrettyPrintSpec.js +0 -332
- data/lib/jasmine-core/spec/core/QueueRunnerSpec.js +0 -670
- data/lib/jasmine-core/spec/core/ReportDispatcherSpec.js +0 -140
- data/lib/jasmine-core/spec/core/SpecSpec.js +0 -407
- data/lib/jasmine-core/spec/core/SpyRegistrySpec.js +0 -364
- data/lib/jasmine-core/spec/core/SpySpec.js +0 -177
- data/lib/jasmine-core/spec/core/SpyStrategySpec.js +0 -202
- data/lib/jasmine-core/spec/core/StackTraceSpec.js +0 -166
- data/lib/jasmine-core/spec/core/SuiteSpec.js +0 -123
- data/lib/jasmine-core/spec/core/TimerSpec.js +0 -31
- data/lib/jasmine-core/spec/core/TreeProcessorSpec.js +0 -794
- data/lib/jasmine-core/spec/core/UserContextSpec.js +0 -54
- data/lib/jasmine-core/spec/core/UtilSpec.js +0 -105
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js +0 -91
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnythingSpec.js +0 -76
- data/lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js +0 -52
- data/lib/jasmine-core/spec/core/asymmetric_equality/ArrayWithExactContentsSpec.js +0 -47
- data/lib/jasmine-core/spec/core/asymmetric_equality/ObjectContainingSpec.js +0 -99
- data/lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js +0 -27
- data/lib/jasmine-core/spec/core/formatErrorMsgSpec.js +0 -13
- data/lib/jasmine-core/spec/core/integration/CustomMatchersSpec.js +0 -200
- data/lib/jasmine-core/spec/core/integration/CustomSpyStrategiesSpec.js +0 -138
- data/lib/jasmine-core/spec/core/integration/EnvSpec.js +0 -2344
- data/lib/jasmine-core/spec/core/integration/SpecRunningSpec.js +0 -976
- data/lib/jasmine-core/spec/core/matchers/DiffBuilderSpec.js +0 -47
- data/lib/jasmine-core/spec/core/matchers/NullDiffBuilderSpec.js +0 -13
- data/lib/jasmine-core/spec/core/matchers/ObjectPathSpec.js +0 -43
- data/lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js +0 -645
- data/lib/jasmine-core/spec/core/matchers/nothingSpec.js +0 -8
- data/lib/jasmine-core/spec/core/matchers/toBeCloseToSpec.js +0 -93
- data/lib/jasmine-core/spec/core/matchers/toBeDefinedSpec.js +0 -18
- data/lib/jasmine-core/spec/core/matchers/toBeFalsySpec.js +0 -38
- data/lib/jasmine-core/spec/core/matchers/toBeGreaterThanOrEqualSpec.js +0 -29
- data/lib/jasmine-core/spec/core/matchers/toBeGreaterThanSpec.js +0 -20
- data/lib/jasmine-core/spec/core/matchers/toBeLessThanOrEqualSpec.js +0 -29
- data/lib/jasmine-core/spec/core/matchers/toBeLessThanSpec.js +0 -20
- data/lib/jasmine-core/spec/core/matchers/toBeNaNSpec.js +0 -37
- data/lib/jasmine-core/spec/core/matchers/toBeNegativeInfinitySpec.js +0 -31
- data/lib/jasmine-core/spec/core/matchers/toBeNullSpec.js +0 -17
- data/lib/jasmine-core/spec/core/matchers/toBePositiveInfinitySpec.js +0 -31
- data/lib/jasmine-core/spec/core/matchers/toBeSpec.js +0 -17
- data/lib/jasmine-core/spec/core/matchers/toBeTruthySpec.js +0 -38
- data/lib/jasmine-core/spec/core/matchers/toBeUndefinedSpec.js +0 -18
- data/lib/jasmine-core/spec/core/matchers/toContainSpec.js +0 -26
- data/lib/jasmine-core/spec/core/matchers/toEqualSpec.js +0 -785
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledBeforeSpec.js +0 -99
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledSpec.js +0 -47
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledTimesSpec.js +0 -86
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledWithSpec.js +0 -67
- data/lib/jasmine-core/spec/core/matchers/toMatchSpec.js +0 -43
- data/lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js +0 -315
- data/lib/jasmine-core/spec/core/matchers/toThrowMatchingSpec.js +0 -73
- data/lib/jasmine-core/spec/core/matchers/toThrowSpec.js +0 -100
- data/lib/jasmine-core/spec/helpers/BrowserFlags.js +0 -15
- data/lib/jasmine-core/spec/helpers/asyncAwait.js +0 -27
- data/lib/jasmine-core/spec/helpers/checkForMap.js +0 -37
- data/lib/jasmine-core/spec/helpers/checkForSet.js +0 -41
- data/lib/jasmine-core/spec/helpers/checkForSymbol.js +0 -28
- data/lib/jasmine-core/spec/helpers/checkForTypedArrays.js +0 -20
- data/lib/jasmine-core/spec/helpers/defineJasmineUnderTest.js +0 -6
- data/lib/jasmine-core/spec/helpers/integrationMatchers.js +0 -43
- data/lib/jasmine-core/spec/helpers/nodeDefineJasmineUnderTest.js +0 -30
- data/lib/jasmine-core/spec/html/HtmlReporterSpec.js +0 -1261
- data/lib/jasmine-core/spec/html/HtmlSpecFilterSpec.js +0 -18
- data/lib/jasmine-core/spec/html/MatchersHtmlSpec.js +0 -37
- data/lib/jasmine-core/spec/html/PrettyPrintHtmlSpec.js +0 -27
- data/lib/jasmine-core/spec/html/QueryStringSpec.js +0 -72
- data/lib/jasmine-core/spec/html/ResultsNodeSpec.js +0 -62
- data/lib/jasmine-core/spec/html/SpyRegistryHtmlSpec.js +0 -39
- data/lib/jasmine-core/spec/html/matchers/toHaveClassSpec.js +0 -48
- data/lib/jasmine-core/spec/npmPackage/npmPackageSpec.js +0 -101
- data/lib/jasmine-core/spec/performance/large_object_test.js +0 -36
- data/lib/jasmine-core/spec/performance/performance_test.js +0 -10
@@ -1,93 +0,0 @@
|
|
1
|
-
describe("toBeCloseTo", function() {
|
2
|
-
it("passes when within two decimal places by default", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeCloseTo(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(0, 0);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
|
9
|
-
result = matcher.compare(0, 0.001);
|
10
|
-
expect(result.pass).toBe(true);
|
11
|
-
|
12
|
-
result = matcher.compare(0, 0.005);
|
13
|
-
expect(result.pass).toBe(true);
|
14
|
-
});
|
15
|
-
|
16
|
-
it("fails when not within two decimal places by default", function() {
|
17
|
-
var matcher = jasmineUnderTest.matchers.toBeCloseTo(),
|
18
|
-
result;
|
19
|
-
|
20
|
-
result = matcher.compare(0, 0.01);
|
21
|
-
expect(result.pass).toBe(false);
|
22
|
-
|
23
|
-
result = matcher.compare(0, 0.05);
|
24
|
-
expect(result.pass).toBe(false);
|
25
|
-
});
|
26
|
-
|
27
|
-
it("accepts an optional precision argument", function() {
|
28
|
-
var matcher = jasmineUnderTest.matchers.toBeCloseTo(),
|
29
|
-
result;
|
30
|
-
|
31
|
-
result = matcher.compare(0, 0.1, 0);
|
32
|
-
expect(result.pass).toBe(true);
|
33
|
-
|
34
|
-
result = matcher.compare(0, 0.5, 0);
|
35
|
-
expect(result.pass).toBe(true);
|
36
|
-
|
37
|
-
result = matcher.compare(0, 0.0001, 3);
|
38
|
-
expect(result.pass).toBe(true);
|
39
|
-
|
40
|
-
result = matcher.compare(0, 0.0005, 3);
|
41
|
-
expect(result.pass).toBe(true);
|
42
|
-
|
43
|
-
result = matcher.compare(0, 0.00001, 4);
|
44
|
-
expect(result.pass).toBe(true);
|
45
|
-
|
46
|
-
result = matcher.compare(0, 0.00005, 4);
|
47
|
-
expect(result.pass).toBe(true);
|
48
|
-
});
|
49
|
-
|
50
|
-
it("fails when one of the arguments is null", function() {
|
51
|
-
var matcher = jasmineUnderTest.matchers.toBeCloseTo();
|
52
|
-
|
53
|
-
expect(function() {
|
54
|
-
matcher.compare(null, null);
|
55
|
-
}).toThrowError('Cannot use toBeCloseTo with null. Arguments evaluated to: expect(null).toBeCloseTo(null).');
|
56
|
-
|
57
|
-
expect(function() {
|
58
|
-
matcher.compare(0, null);
|
59
|
-
}).toThrowError('Cannot use toBeCloseTo with null. Arguments evaluated to: expect(0).toBeCloseTo(null).');
|
60
|
-
|
61
|
-
expect(function() {
|
62
|
-
matcher.compare(null, 0);
|
63
|
-
}).toThrowError('Cannot use toBeCloseTo with null. Arguments evaluated to: expect(null).toBeCloseTo(0).');
|
64
|
-
});
|
65
|
-
|
66
|
-
it("rounds expected values", function() {
|
67
|
-
var matcher = jasmineUnderTest.matchers.toBeCloseTo(),
|
68
|
-
result;
|
69
|
-
|
70
|
-
result = matcher.compare(1.23, 1.229);
|
71
|
-
expect(result.pass).toBe(true);
|
72
|
-
|
73
|
-
result = matcher.compare(1.23, 1.226);
|
74
|
-
expect(result.pass).toBe(true);
|
75
|
-
|
76
|
-
result = matcher.compare(1.23, 1.225);
|
77
|
-
expect(result.pass).toBe(true);
|
78
|
-
|
79
|
-
result = matcher.compare(1.23, 1.235);
|
80
|
-
expect(result.pass).toBe(true);
|
81
|
-
|
82
|
-
// 1.2249999 will be rounded to 1.225
|
83
|
-
result = matcher.compare(1.23, 1.2249999);
|
84
|
-
expect(result.pass).toBe(true);
|
85
|
-
|
86
|
-
// 1.2249999 will be rounded to 1.224
|
87
|
-
result = matcher.compare(1.23, 1.2244999);
|
88
|
-
expect(result.pass).toBe(false);
|
89
|
-
|
90
|
-
result = matcher.compare(1.23, 1.234);
|
91
|
-
expect(result.pass).toBe(true);
|
92
|
-
});
|
93
|
-
});
|
@@ -1,18 +0,0 @@
|
|
1
|
-
describe("toBeDefined", function() {
|
2
|
-
it("matches for defined values", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeDefined(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
|
7
|
-
result = matcher.compare('foo');
|
8
|
-
expect(result.pass).toBe(true);
|
9
|
-
});
|
10
|
-
|
11
|
-
it("fails when matching undefined values", function() {
|
12
|
-
var matcher = jasmineUnderTest.matchers.toBeDefined(),
|
13
|
-
result;
|
14
|
-
|
15
|
-
result = matcher.compare(void 0);
|
16
|
-
expect(result.pass).toBe(false);
|
17
|
-
})
|
18
|
-
});
|
@@ -1,38 +0,0 @@
|
|
1
|
-
describe("toBeFalsy", function() {
|
2
|
-
it("passes for 'falsy' values", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeFalsy(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(false);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
|
9
|
-
result = matcher.compare(0);
|
10
|
-
expect(result.pass).toBe(true);
|
11
|
-
|
12
|
-
result = matcher.compare('');
|
13
|
-
expect(result.pass).toBe(true);
|
14
|
-
|
15
|
-
result = matcher.compare(null);
|
16
|
-
expect(result.pass).toBe(true);
|
17
|
-
|
18
|
-
result = matcher.compare(void 0);
|
19
|
-
expect(result.pass).toBe(true);
|
20
|
-
});
|
21
|
-
|
22
|
-
it("fails for 'truthy' values", function() {
|
23
|
-
var matcher = jasmineUnderTest.matchers.toBeFalsy(),
|
24
|
-
result;
|
25
|
-
|
26
|
-
result = matcher.compare(true);
|
27
|
-
expect(result.pass).toBe(false);
|
28
|
-
|
29
|
-
result = matcher.compare(1);
|
30
|
-
expect(result.pass).toBe(false);
|
31
|
-
|
32
|
-
result = matcher.compare("foo");
|
33
|
-
expect(result.pass).toBe(false);
|
34
|
-
|
35
|
-
result = matcher.compare({});
|
36
|
-
expect(result.pass).toBe(false);
|
37
|
-
});
|
38
|
-
});
|
@@ -1,29 +0,0 @@
|
|
1
|
-
describe("toBeGreaterThanOrEqual", function() {
|
2
|
-
it("passes when actual >= expected", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeGreaterThanOrEqual(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(2, 1);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
|
9
|
-
result = matcher.compare(1, 1);
|
10
|
-
expect(result.pass).toBe(true);
|
11
|
-
|
12
|
-
result = matcher.compare(1.0000001, 1);
|
13
|
-
expect(result.pass).toBe(true);
|
14
|
-
|
15
|
-
result = matcher.compare(1.0, 1.0);
|
16
|
-
expect(result.pass).toBe(true);
|
17
|
-
})
|
18
|
-
|
19
|
-
it("fails when actual < expected", function() {
|
20
|
-
var matcher = jasmineUnderTest.matchers.toBeGreaterThanOrEqual(),
|
21
|
-
result;
|
22
|
-
|
23
|
-
result = matcher.compare(1, 2);
|
24
|
-
expect(result.pass).toBe(false);
|
25
|
-
|
26
|
-
result = matcher.compare(1, 1.0000001);
|
27
|
-
expect(result.pass).toBe(false);
|
28
|
-
})
|
29
|
-
});
|
@@ -1,20 +0,0 @@
|
|
1
|
-
describe("toBeGreaterThan", function() {
|
2
|
-
it("passes when actual > expected", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeGreaterThan(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(2, 1);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
});
|
9
|
-
|
10
|
-
it("fails when actual <= expected", function() {
|
11
|
-
var matcher = jasmineUnderTest.matchers.toBeGreaterThan(),
|
12
|
-
result;
|
13
|
-
|
14
|
-
result = matcher.compare(1, 1);
|
15
|
-
expect(result.pass).toBe(false);
|
16
|
-
|
17
|
-
result = matcher.compare(1, 2);
|
18
|
-
expect(result.pass).toBe(false);
|
19
|
-
});
|
20
|
-
});
|
@@ -1,29 +0,0 @@
|
|
1
|
-
describe("toBeLessThanOrEqual", function() {
|
2
|
-
it("passes when actual <= expected", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeLessThanOrEqual(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(1, 2);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
|
9
|
-
result = matcher.compare(1, 1);
|
10
|
-
expect(result.pass).toBe(true);
|
11
|
-
|
12
|
-
result = matcher.compare(1, 1.0000001);
|
13
|
-
expect(result.pass).toBe(true);
|
14
|
-
|
15
|
-
result = matcher.compare(1.0, 1.0);
|
16
|
-
expect(result.pass).toBe(true);
|
17
|
-
});
|
18
|
-
|
19
|
-
it("fails when actual < expected", function() {
|
20
|
-
var matcher = jasmineUnderTest.matchers.toBeLessThanOrEqual(),
|
21
|
-
result;
|
22
|
-
|
23
|
-
result = matcher.compare(2, 1);
|
24
|
-
expect(result.pass).toBe(false);
|
25
|
-
|
26
|
-
result = matcher.compare(1.0000001, 1);
|
27
|
-
expect(result.pass).toBe(false);
|
28
|
-
});
|
29
|
-
});
|
@@ -1,20 +0,0 @@
|
|
1
|
-
describe("toBeLessThan", function() {
|
2
|
-
it("passes when actual < expected", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeLessThan(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(1, 2);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
});
|
9
|
-
|
10
|
-
it("fails when actual <= expected", function() {
|
11
|
-
var matcher = jasmineUnderTest.matchers.toBeLessThan(),
|
12
|
-
result;
|
13
|
-
|
14
|
-
result = matcher.compare(1, 1);
|
15
|
-
expect(result.pass).toBe(false);
|
16
|
-
|
17
|
-
result = matcher.compare(2, 1);
|
18
|
-
expect(result.pass).toBe(false);
|
19
|
-
});
|
20
|
-
});
|
@@ -1,37 +0,0 @@
|
|
1
|
-
describe("toBeNaN", function() {
|
2
|
-
it("passes for NaN with a custom .not fail", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeNaN(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(Number.NaN);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
expect(result.message).toEqual("Expected actual not to be NaN.");
|
9
|
-
});
|
10
|
-
|
11
|
-
it("fails for anything not a NaN", function() {
|
12
|
-
var matcher = jasmineUnderTest.matchers.toBeNaN(),
|
13
|
-
result;
|
14
|
-
|
15
|
-
result = matcher.compare(1);
|
16
|
-
expect(result.pass).toBe(false);
|
17
|
-
|
18
|
-
result = matcher.compare(null);
|
19
|
-
expect(result.pass).toBe(false);
|
20
|
-
|
21
|
-
result = matcher.compare(void 0);
|
22
|
-
expect(result.pass).toBe(false);
|
23
|
-
|
24
|
-
result = matcher.compare('');
|
25
|
-
expect(result.pass).toBe(false);
|
26
|
-
|
27
|
-
result = matcher.compare(Number.POSITIVE_INFINITY);
|
28
|
-
expect(result.pass).toBe(false);
|
29
|
-
});
|
30
|
-
|
31
|
-
it("has a custom message on failure", function() {
|
32
|
-
var matcher = jasmineUnderTest.matchers.toBeNaN(),
|
33
|
-
result = matcher.compare(0);
|
34
|
-
|
35
|
-
expect(result.message()).toEqual("Expected 0 to be NaN.");
|
36
|
-
});
|
37
|
-
});
|
@@ -1,31 +0,0 @@
|
|
1
|
-
describe("toBeNegativeInfinity", function() {
|
2
|
-
it("fails for anything that isn't -Infinity", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeNegativeInfinity(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(1);
|
7
|
-
expect(result.pass).toBe(false);
|
8
|
-
|
9
|
-
result = matcher.compare(Number.NaN);
|
10
|
-
expect(result.pass).toBe(false);
|
11
|
-
|
12
|
-
result = matcher.compare(null);
|
13
|
-
expect(result.pass).toBe(false);
|
14
|
-
});
|
15
|
-
|
16
|
-
it("has a custom message on failure", function() {
|
17
|
-
var matcher = jasmineUnderTest.matchers.toBeNegativeInfinity(),
|
18
|
-
result = matcher.compare(0);
|
19
|
-
|
20
|
-
expect(result.message()).toEqual("Expected 0 not to be -Infinity.")
|
21
|
-
});
|
22
|
-
|
23
|
-
it("succeeds for -Infinity", function() {
|
24
|
-
var matcher = jasmineUnderTest.matchers.toBeNegativeInfinity(),
|
25
|
-
result = matcher.compare(Number.NEGATIVE_INFINITY);
|
26
|
-
|
27
|
-
expect(result.pass).toBe(true);
|
28
|
-
expect(result.message).toEqual("Expected actual to be -Infinity.")
|
29
|
-
});
|
30
|
-
|
31
|
-
});
|
@@ -1,17 +0,0 @@
|
|
1
|
-
describe("toBeNull", function() {
|
2
|
-
it("passes for null", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeNull(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(null);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
});
|
9
|
-
|
10
|
-
it("fails for non-null", function() {
|
11
|
-
var matcher = jasmineUnderTest.matchers.toBeNull(),
|
12
|
-
result;
|
13
|
-
|
14
|
-
result = matcher.compare('foo');
|
15
|
-
expect(result.pass).toBe(false);
|
16
|
-
});
|
17
|
-
});
|
@@ -1,31 +0,0 @@
|
|
1
|
-
describe("toBePositiveInfinity", function() {
|
2
|
-
it("fails for anything that isn't Infinity", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBePositiveInfinity(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(1);
|
7
|
-
expect(result.pass).toBe(false);
|
8
|
-
|
9
|
-
result = matcher.compare(Number.NaN);
|
10
|
-
expect(result.pass).toBe(false);
|
11
|
-
|
12
|
-
result = matcher.compare(null);
|
13
|
-
expect(result.pass).toBe(false);
|
14
|
-
});
|
15
|
-
|
16
|
-
it("has a custom message on failure", function() {
|
17
|
-
var matcher = jasmineUnderTest.matchers.toBePositiveInfinity(),
|
18
|
-
result = matcher.compare(0);
|
19
|
-
|
20
|
-
expect(result.message()).toEqual("Expected 0 not to be Infinity.")
|
21
|
-
});
|
22
|
-
|
23
|
-
it("succeeds for Infinity", function() {
|
24
|
-
var matcher = jasmineUnderTest.matchers.toBePositiveInfinity(),
|
25
|
-
result = matcher.compare(Number.POSITIVE_INFINITY);
|
26
|
-
|
27
|
-
expect(result.pass).toBe(true);
|
28
|
-
expect(result.message).toEqual("Expected actual to be Infinity.")
|
29
|
-
});
|
30
|
-
|
31
|
-
});
|
@@ -1,17 +0,0 @@
|
|
1
|
-
describe("toBe", function() {
|
2
|
-
it("passes when actual === expected", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBe(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(1, 1);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
});
|
9
|
-
|
10
|
-
it("fails when actual !== expected", function() {
|
11
|
-
var matcher = jasmineUnderTest.matchers.toBe(),
|
12
|
-
result;
|
13
|
-
|
14
|
-
result = matcher.compare(1, 2);
|
15
|
-
expect(result.pass).toBe(false);
|
16
|
-
});
|
17
|
-
});
|
@@ -1,38 +0,0 @@
|
|
1
|
-
describe("toBeTruthy", function() {
|
2
|
-
it("passes for 'truthy' values", function() {
|
3
|
-
var matcher = jasmineUnderTest.matchers.toBeTruthy(),
|
4
|
-
result;
|
5
|
-
|
6
|
-
result = matcher.compare(true);
|
7
|
-
expect(result.pass).toBe(true);
|
8
|
-
|
9
|
-
result = matcher.compare(1);
|
10
|
-
expect(result.pass).toBe(true);
|
11
|
-
|
12
|
-
result = matcher.compare("foo");
|
13
|
-
expect(result.pass).toBe(true);
|
14
|
-
|
15
|
-
result = matcher.compare({});
|
16
|
-
expect(result.pass).toBe(true);
|
17
|
-
});
|
18
|
-
|
19
|
-
it("fails for 'falsy' values", function() {
|
20
|
-
var matcher = jasmineUnderTest.matchers.toBeTruthy(),
|
21
|
-
result;
|
22
|
-
|
23
|
-
result = matcher.compare(false);
|
24
|
-
expect(result.pass).toBe(false);
|
25
|
-
|
26
|
-
result = matcher.compare(0);
|
27
|
-
expect(result.pass).toBe(false);
|
28
|
-
|
29
|
-
result = matcher.compare('');
|
30
|
-
expect(result.pass).toBe(false);
|
31
|
-
|
32
|
-
result = matcher.compare(null);
|
33
|
-
expect(result.pass).toBe(false);
|
34
|
-
|
35
|
-
result = matcher.compare(void 0);
|
36
|
-
expect(result.pass).toBe(false);
|
37
|
-
});
|
38
|
-
});
|