browser.test.js 539 B

1234567891011121314151617181920
  1. import esbuild from 'esbuild';
  2. import assert from 'node:assert/strict';
  3. import { describe, it } from 'node:test';
  4. describe('Bundle for browsers', async () => {
  5. it('esbuild browser build should work', async () => {
  6. try {
  7. const result = await esbuild.build({
  8. platform: 'browser',
  9. entryPoints: ['@astrojs/markdown-remark'],
  10. bundle: true,
  11. write: false,
  12. });
  13. assert.ok(result.outputFiles.length > 0);
  14. } catch (error) {
  15. // Capture any esbuild errors and fail the test
  16. assert.fail(error.message);
  17. }
  18. });
  19. });