0

I made a couple matchers, one designed to always pass, and the other designed to always fail.

Here is my spec file:

/* my-spec.js */
beforeEach(function() {
    var matchers = {
        toPass: function() {
            return {
                compare: function(actual) {
                    return {
                        pass: true
                    };
                }
            };
        },
        toFail: function() {
            return {
                compare: function(actual) {
                    return {
                        pass: false
                    };
                }
            };
        }
    };

    this.addMatchers(matchers);
});

describe("A suite", function() {
    it("contains spec with an expectation", function() {
        expect('this test').toPass();
        expect('this test').toFail();
    });
});

When I run jasmine-node tests (my file is in the tests folder), I see:

.

Finished in 0.018 seconds
1 test, 2 assertions, 0 failures, 0 skipped

What am I doing wrong?

Joncom
  • 1,985
  • 1
  • 18
  • 29

1 Answers1

0

I was using an old version of Jasmine, but following the new documentation.

Joncom
  • 1,985
  • 1
  • 18
  • 29