Skip to content

Commit

Permalink
test: add e2e case for build API (#4081)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Nov 28, 2024
1 parent a3c7b54 commit 440cdbf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions e2e/cases/javascript-api/build/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { expect, test } from '@playwright/test';
import { createRsbuild } from '@rsbuild/core';

test('should allow to call `build` and get stats object', async () => {
const rsbuild = await createRsbuild({
cwd: __dirname,
});

const { stats, close } = await rsbuild.build();

await close();

const result = stats?.toJson({ all: true })!;

expect(result.name).toBe('web');
expect(result.assets?.length).toBeGreaterThan(0);
});
1 change: 1 addition & 0 deletions e2e/cases/javascript-api/build/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('hello');

0 comments on commit 440cdbf

Please sign in to comment.