Skip to content

Commit

Permalink
chore: test
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Sep 30, 2024
1 parent cd18278 commit 94c2fd6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 16 deletions.
12 changes: 0 additions & 12 deletions benchmark/utils.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getCwdByExample, rslibBuild } from 'test-helper';
import { bench, describe } from 'vitest';
import { getCwdByExample, rslibBuild } from './utils';

describe('run rslib in examples', () => {
bench(
Expand Down
1 change: 0 additions & 1 deletion benchmark/package.json → tests/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
},
"devDependencies": {
"@codspeed/vitest-plugin": "^3.1.1",
"@e2e/helper": "workspace:*",
"@rslib/tsconfig": "workspace:*",
"typescript": "^5.6.2",
"vitest": "^2.0.5"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import codspeedPlugin from '@codspeed/vitest-plugin';
import { defineConfig } from 'vitest/config';
import { shared } from '../vitest.workspace';
import { shared } from '../../vitest.workspace';

export default defineConfig({
test: {
Expand Down
10 changes: 9 additions & 1 deletion tests/scripts/shared.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from 'node:fs';
import { join } from 'node:path';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import {
type InspectConfigResult,
mergeRsbuildConfig as mergeConfig,
Expand All @@ -8,6 +9,13 @@ import type { Format, LibConfig, RslibConfig } from '@rslib/core';
import { build, loadConfig } from '@rslib/core';
import { globContentJSON } from './helper';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export function getCwdByExample(exampleName: string) {
return join(__dirname, '../../examples', exampleName);
}

export function generateBundleEsmConfig(config: LibConfig = {}): LibConfig {
const esmBasicConfig: LibConfig = {
format: 'esm',
Expand Down

0 comments on commit 94c2fd6

Please sign in to comment.