UNPKG

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