3.2.0 • Published 5 years ago

stu v3.2.0

Weekly downloads
14
License
MIT
Repository
github
Last release
5 years ago

Stu

A shoddy replacement for jest that works with mocha and sinon but is way faster.

Basically it allows you to stub entire modules that are required by the file you are testing.

Installation

npm install --save-dev stu

Usage

import test from 'ava';
import * as stu from 'stu';

test.beforeEach((t) => {
  t.context = {
    ...t.context,
    library: stu.mock('library'),
    mycode: stu.test('../mycode').default
  };
})

test('should do stuff with thing', (t) => {
    const { library, mycode } = t.context;

  library.returns('some value');
  mycode();
  t.deepEqual(library.args, [['a', 'b', 'c']]);
});
3.2.0

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.0.0

6 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.3

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.12

8 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago