refactor: testing
This commit is contained in:
parent
394a3038c4
commit
36fdb62bf5
|
@ -1,7 +1,6 @@
|
|||
import {expect} from 'chai';
|
||||
import Middleware from '../src/middleware';
|
||||
|
||||
describe('@latus/core', () => {
|
||||
describe('middleware', () => {
|
||||
it('should construct with middleware', (done) => {
|
||||
let called = false;
|
||||
|
@ -70,4 +69,3 @@ describe('@latus/core', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -26,7 +26,10 @@ const client = {
|
|||
neutrino.options.root = fs.realpathSync(root);
|
||||
neutrino.options.source = 'client';
|
||||
neutrino.options.mains.index = 'index';
|
||||
neutrino.options.mains.tests = {entry: './client/tests'};
|
||||
neutrino.options.mains.tests = {
|
||||
entry: './client/tests',
|
||||
title: 'Mocha tests',
|
||||
};
|
||||
const output = 'build';
|
||||
neutrino.options.output = join(
|
||||
isAbsolute(output)
|
||||
|
@ -85,11 +88,11 @@ const client = {
|
|||
'};',
|
||||
].join('\n'));
|
||||
const testPaths = paths
|
||||
.map((path) => Latus.runtimePath(`${path}/test`))
|
||||
.filter((path) => !!path);
|
||||
plugin.writeModule(`node_modules/@latus/core/tests`, [
|
||||
testPaths.map((path) => `require('${path}')`),
|
||||
].join('\n'));
|
||||
.map((path) => [path, Latus.runtimePath(`${path}/test`)])
|
||||
.filter(([, path]) => !!path);
|
||||
plugin.writeModule(`node_modules/@latus/core/tests`, testPaths.map(
|
||||
([original, path]) => `describe('${original}', () => require('${path}'));`
|
||||
).join(''));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user