Files
wehub-resource-sync 2d398e1894
Deploy Github Pages / deploy (push) Failing after 1s
chore: import upstream snapshot with attribution
2026-07-13 12:30:43 +08:00

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();
});
});