diff --git a/spec/core/matchers/nothingSpec.js b/spec/core/matchers/nothingSpec.js new file mode 100644 index 00000000..8fefa119 --- /dev/null +++ b/spec/core/matchers/nothingSpec.js @@ -0,0 +1,8 @@ +describe('nothing', function() { + it('should pass', function() { + var matcher = jasmineUnderTest.matchers.nothing(), + result = matcher.compare(); + + expect(result.pass).toBe(true); + }); +}); diff --git a/src/core/matchers/nothing.js b/src/core/matchers/nothing.js new file mode 100644 index 00000000..625236b3 --- /dev/null +++ b/src/core/matchers/nothing.js @@ -0,0 +1,20 @@ +getJasmineRequireObj().nothing = function() { + /** + * {@link expect} nothing explicitly. + * @function + * @name matchers#nothing + * @example + * expect().nothing(); + */ + function nothing() { + return { + compare: function() { + return { + pass: true + }; + } + }; + } + + return nothing; +}; diff --git a/src/core/matchers/requireMatchers.js b/src/core/matchers/requireMatchers.js index 437a2b0f..0d365617 100644 --- a/src/core/matchers/requireMatchers.js +++ b/src/core/matchers/requireMatchers.js @@ -1,5 +1,6 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) { var availableMatchers = [ + 'nothing', 'toBe', 'toBeCloseTo', 'toBeDefined',