UNPKG

@incdevco/framework

Version:
35 lines (18 loc) 590 B
var Expect = require('chai').expect; var Mocked = require('./index'); describe('mock/mocked', function () { 'use strict'; it('should throw an exception when an expectation is not met', function (done) { var mocked, obj; obj = {}; mocked = new Mocked(obj); mocked.expect('test') .willReturn('result'); try { mocked.done(); } catch (exception) { Expect(exception.message).to.equal('expectation for \'test\' not met.', 'exception.message'); done(); } }); });