Skip to content

Commit

Permalink
chore: add testing
Browse files Browse the repository at this point in the history
  • Loading branch information
fupengl committed Jun 14, 2022
1 parent a94440d commit b9c7202
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/stan-utils/__tests__/stan-utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
import { slash } from '../src';
import { join } from 'path';
import { existsSync } from 'fs';
import { slash, copyFiles } from '../src';

describe('stan-utils', () => {
it('test slash', () => {
expect(slash('src\\index.ts')).toBe('src/index.ts');
});

it('test copyFiles', async () => {
const dest = 'node_modules/__output__';
await copyFiles({
targets: {
src: 'src/*.ts',
dest,
},
verbose: true,
flatten: false,
cwd: join(__dirname, '..'),
});
expect(existsSync(join(__dirname, '../', dest, 'copy-files.ts'))).toBe(true);
});
});

0 comments on commit b9c7202

Please sign in to comment.