Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

sinon-typed

0.1.1 • Public • Published

Sinon Typed Build Status Coverage Status

npm install --save-dev sinon
npm install --save-dev @types/sinon
npm install --save-dev sinon-typed

Usage

import * as assert from 'assert';
import {SinonTyped} from 'sinon-typed';
 
interface Test {
  aProperty: number;
  aMethod(arg: string): string;
}
 
const testStub = SinonTyped.stub<Test>();
testStub.stubMethod('aMethod').withArgs('value').returns('result');
testStub.stubProperty('aProperty').returns(42);
const test = testStub.object;
assert.equal(test.aMethod('value'), 'result');
assert.equal(test.aProperty, 42);

Install

npm i sinon-typed

DownloadsWeekly Downloads

24

Version

0.1.1

License

BSD-3-Clause

Unpacked Size

54.9 kB

Total Files

34

Last publish

Collaborators

  • avatar