tsbundle/test/test.ts

41 lines
932 B
TypeScript
Raw Permalink Normal View History

2019-04-20 17:59:33 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
2022-03-15 23:21:05 +00:00
import * as tsbundle from '../ts/index.js';
2019-04-20 17:59:33 +00:00
2021-07-22 19:55:08 +00:00
import * as path from 'path';
2022-03-15 23:21:05 +00:00
tap.test('should bundle with esbuild', async () => {
2021-07-23 13:45:23 +00:00
const tsbundleInstance = new tsbundle.TsBundle();
2022-03-15 23:21:05 +00:00
await tsbundleInstance.build(
2022-03-14 15:32:12 +00:00
process.cwd() + '/test',
'./ts_web/index.ts',
'./dist_manual/test.js',
2022-03-15 23:21:05 +00:00
{
bundler: 'esbuild'
}
2022-03-14 15:32:12 +00:00
);
});
2019-04-20 17:59:33 +00:00
2022-03-15 23:21:05 +00:00
tap.test('should bundle with parcel', async () => {
2021-07-22 19:55:08 +00:00
const tsbundleInstance = new tsbundle.TsBundle();
2022-03-15 23:21:05 +00:00
await tsbundleInstance.build(
process.cwd() + '/test',
'./ts_web/index.ts',
'./dist_manual/test.js',
{
bundler: 'parcel'
}
);
});
tap.test('should bundle with rollup', async () => {
const tsbundleInstance = new tsbundle.TsBundle();
await tsbundleInstance.build(
2022-03-14 15:32:12 +00:00
process.cwd(),
'./test/ts_web/index.ts',
2022-03-15 12:45:03 +00:00
'./test/dist_manual/production.js',
2022-03-15 23:21:05 +00:00
{bundler: 'rollup'}
2022-03-14 15:32:12 +00:00
);
});
2021-07-22 19:55:08 +00:00
2019-04-20 17:59:33 +00:00
tap.start();