Example #1
0
test('instantiates in test environment', t => {
  const api = Neutrino({ env: { NODE_ENV: 'test' } });

  api.use(mw());

  t.notThrows(() => api.config.toConfig());
});
test('instantiates with options', t => {
  const api = Neutrino();

  api.use(mw(), options);

  t.notThrows(() => api.config.toConfig());
});
Example #3
0
test('exposes lint command', t => {
  const api = Neutrino();

  api.use(mw());

  t.is(typeof api.commands.lint, 'function');
});
Example #4
0
test('uses preset', t => {
  const api = Neutrino();

  t.notThrows(() => api.use(mw()));
});
Example #5
0
test('uses preset in test environment', t => {
  const api = Neutrino({ env: { NODE_ENV: 'test' } });

  t.notThrows(() => api.use(mw()));
});
test('uses with options', t => {
  const api = Neutrino();

  t.notThrows(() => api.use(mw(), options));
});
test('uses middleware', t => {
  const api = Neutrino();

  t.notThrows(() => api.use(mw()));
});
Example #8
0
test('exposes eslintrc config', t => {
  const api = Neutrino();

  t.is(typeof api.call('eslintrc', [mw()]), 'object');
});
Example #9
0
const { Neutrino } = require('neutrino');

module.exports = Neutrino({ root: __dirname })
  .use('.neutrinorc.js')
  .call('eslintrc');