Remove deprecated class jasmine.Reporters.
Fully deprecate old-style Matchers; will be removed in next major version.
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
<script type="text/javascript" src="../src/NestedResults.js"></script>
|
||||
<script type="text/javascript" src="../src/PrettyPrinter.js"></script>
|
||||
<script type="text/javascript" src="../src/Queue.js"></script>
|
||||
<script type="text/javascript" src="../src/Reporters.js"></script>
|
||||
<script type="text/javascript" src="../src/Runner.js"></script>
|
||||
<script type="text/javascript" src="../src/Spec.js"></script>
|
||||
<script type="text/javascript" src="../src/Suite.js"></script>
|
||||
|
||||
@@ -85,28 +85,4 @@ describe("Custom Matchers", function() {
|
||||
|
||||
expect(matcherCallArgs).toEqual([[], ['arg'], ['arg1', 'arg2']]);
|
||||
});
|
||||
|
||||
describe("in the old style", function() {
|
||||
it("should report a deprecation error", function() {
|
||||
var spec;
|
||||
var suite = env.describe('some suite', function() {
|
||||
spec = env.it('spec with an expectation').runs(function () {
|
||||
this.addMatchers({
|
||||
toBeTrue: function() {
|
||||
this.report(this.actual === true, this.actual + " was not true.", "details");
|
||||
}
|
||||
});
|
||||
this.expect(true).toBeTrue();
|
||||
this.expect(false).toBeTrue();
|
||||
});
|
||||
});
|
||||
|
||||
suite.execute();
|
||||
var passResult = new jasmine.ExpectationResult({passed: true, message: "Passed.", details: "details"});
|
||||
var failResult = new jasmine.ExpectationResult({passed: false, message: "false was not true.", details: "details"});
|
||||
failResult.trace = jasmine.any(Object);
|
||||
expect(spec.results().getItems()).toEqual([passResult, failResult]);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
@@ -523,22 +523,6 @@ describe("jasmine.Matchers", function() {
|
||||
match(false).not.custom();
|
||||
expect(lastResult().message).toEqual("Passed.");
|
||||
});
|
||||
|
||||
it("should make old-style custom matchers blow up, but only when negated", function() {
|
||||
spec.addMatchers({
|
||||
custom: function() {
|
||||
this.report();
|
||||
}
|
||||
});
|
||||
|
||||
expect(function() {
|
||||
match(true).custom();
|
||||
}).not.toThrow();
|
||||
|
||||
expect(function() {
|
||||
match(true).not.custom();
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe("spy matchers >>", function() {
|
||||
|
||||
@@ -33,20 +33,16 @@ describe('jasmine.Reporter', function() {
|
||||
var bar = 0;
|
||||
var baz = 0;
|
||||
|
||||
var specCallback = function (results) {
|
||||
foo++;
|
||||
};
|
||||
var suiteCallback = function (results) {
|
||||
bar++;
|
||||
};
|
||||
var runnerCallback = function (results) {
|
||||
baz++;
|
||||
};
|
||||
|
||||
env.reporter = jasmine.Reporters.reporter({
|
||||
specCallback: specCallback,
|
||||
suiteCallback: suiteCallback,
|
||||
runnerCallback: runnerCallback
|
||||
env.addReporter({
|
||||
reportSpecResults: function() {
|
||||
foo++;
|
||||
},
|
||||
reportSuiteResults: function() {
|
||||
bar++;
|
||||
},
|
||||
reportRunnerResults: function() {
|
||||
baz++;
|
||||
}
|
||||
});
|
||||
|
||||
var runner = env.currentRunner();
|
||||
|
||||
Reference in New Issue
Block a user