Skip to content

Commit

Permalink
fix: missing rslib config
Browse files Browse the repository at this point in the history
  • Loading branch information
elcoosp committed Nov 28, 2024
1 parent bcf4523 commit 46f4931
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 5 deletions.
2 changes: 0 additions & 2 deletions packages/mm-rslib/dummy.test.ts

This file was deleted.

10 changes: 10 additions & 0 deletions packages/mm-rslib/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from '@rslib/core';

export default defineConfig({
lib: [
{
format: 'esm',
syntax: 'es2021',
},
],
});
3 changes: 3 additions & 0 deletions packages/mm-rslib/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const ERROR_MESSAGE =
'There is no js files exported in this package, check the template folder';
console.error(ERROR_MESSAGE);
8 changes: 8 additions & 0 deletions packages/mm-rslib/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect, test, vi } from 'vitest';

test('index', async () => {
const consoleSpy = vi.spyOn(console, 'error');
const { ERROR_MESSAGE } = await import('../src/index');
expect(consoleSpy).toHaveBeenCalledOnce();
expect(consoleSpy).toHaveBeenLastCalledWith(ERROR_MESSAGE);
});
3 changes: 0 additions & 3 deletions packages/mm-vite-react/dummy.test.ts

This file was deleted.

10 changes: 10 additions & 0 deletions packages/mm-vite-react/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from '@rslib/core';

export default defineConfig({
lib: [
{
format: 'esm',
syntax: 'es2021',
},
],
});
3 changes: 3 additions & 0 deletions packages/mm-vite-react/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const ERROR_MESSAGE =
'There is no js files exported in this package, check the template folder';
console.error(ERROR_MESSAGE);
8 changes: 8 additions & 0 deletions packages/mm-vite-react/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect, test, vi } from 'vitest';

test('index', async () => {
const consoleSpy = vi.spyOn(console, 'error');
const { ERROR_MESSAGE } = await import('../src/index');
expect(consoleSpy).toHaveBeenCalledOnce();
expect(consoleSpy).toHaveBeenLastCalledWith(ERROR_MESSAGE);
});

0 comments on commit 46f4931

Please sign in to comment.