tachybase_todo/packages/create-nocobase-app/src/index.test.ts

20 lines
444 B
TypeScript
Executable File

import { rimraf } from '@umijs/utils';
import { existsSync } from 'fs';
import { join } from 'path';
import runGenerator from './index';
const fixtures = join(__dirname, 'fixtures');
const cwd = join(fixtures, 'generate');
test('generate app', async () => {
await runGenerator({
cwd,
args: {
_: [],
$0: '',
},
});
expect(existsSync(join(cwd, 'src', 'pages', 'index.tsx'))).toEqual(true);
rimraf.sync(cwd);
});