mirror of
https://github.com/NetEase/tango.git
synced 2026-07-05 12:54:49 +08:00
* docs: Update * fix: register history tool * fix: add eslint to InputCode * fix: enhance expSetter * fix: transform value to expression code * fix: value change of expSetter * fix: input code without wrapper * fix: disable eslint for InputCode by default --------- Co-authored-by: wwsun <ww.sww@outlook.com>
33 lines
842 B
TypeScript
33 lines
842 B
TypeScript
import { createEngine, Workspace } from '../src';
|
|
|
|
describe('engine', () => {
|
|
it('engine init', () => {
|
|
const engine = createEngine({
|
|
workspace: new Workspace({
|
|
entry: '/src/index.js',
|
|
}),
|
|
});
|
|
expect(engine.workspace.entry).toEqual('/src/index.js');
|
|
});
|
|
|
|
it('engine init without required files', () => {
|
|
const engine = createEngine({
|
|
workspace: new Workspace({
|
|
entry: '/src/index.js',
|
|
files: [
|
|
{
|
|
filename: '/src/index.js',
|
|
code: 'console.log("hello")',
|
|
},
|
|
{
|
|
filename: '/package.json',
|
|
code: JSON.stringify({ name: 'sample' }),
|
|
},
|
|
],
|
|
}),
|
|
});
|
|
expect(engine.workspace.activeViewModule).toBeUndefined();
|
|
expect(engine.workspace.routeModule).toBeUndefined();
|
|
});
|
|
});
|