1 | import test from 'ava';
|
2 | import { Neutrino } from 'neutrino';
|
3 |
|
4 | const mw = () => require('..');
|
5 | const options = { test: /\.js$/, babel: { cacheDirectory: false } };
|
6 |
|
7 | test('loads middleware', t => {
|
8 | t.notThrows(mw);
|
9 | });
|
10 |
|
11 | test('uses middleware', t => {
|
12 | const api = Neutrino();
|
13 |
|
14 | t.notThrows(() => api.use(mw()));
|
15 | });
|
16 |
|
17 | test('uses with options', t => {
|
18 | const api = Neutrino();
|
19 |
|
20 | t.notThrows(() => api.use(mw(), options));
|
21 | });
|
22 |
|
23 | test('instantiates', t => {
|
24 | const api = Neutrino();
|
25 |
|
26 | api.use(mw());
|
27 |
|
28 | t.notThrows(() => api.config.toConfig());
|
29 | });
|
30 |
|
31 | test('instantiates with options', t => {
|
32 | const api = Neutrino();
|
33 |
|
34 | api.use(mw(), options);
|
35 |
|
36 | t.notThrows(() => api.config.toConfig());
|
37 | });
|