File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/core/src/coverage Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { createRequire } from 'node:module';
2
2
import { pathToFileURL } from 'node:url' ;
3
3
import type { RsbuildPlugin } from '@rsbuild/core' ;
4
4
import type { CoverageOptions , CoverageProvider } from '../types/coverage' ;
5
+ import { color } from '../utils' ;
5
6
export const CoverageProviderMap : Record < string , string > = {
6
7
istanbul : '@rstest/coverage-istanbul' ,
7
8
} ;
@@ -31,10 +32,12 @@ export const loadCoverageProvider = async (
31
32
pluginCoverage,
32
33
CoverageProvider,
33
34
} ;
34
- } catch ( error ) {
35
- throw new Error (
36
- `Failed to load coverage provider module: ${ moduleName } in ${ root } . Make sure it is installed.\nOriginal error: ${ ( error as Error ) . message } ` ,
35
+ } catch {
36
+ const error = new Error (
37
+ `Failed to load coverage provider module: ${ color . cyan ( moduleName ) } in ${ color . underline ( root ) } , please make sure it is installed.\n ` ,
37
38
) ;
39
+ error . stack = '' ;
40
+ throw error ;
38
41
}
39
42
} ;
40
43
You can’t perform that action at this time.
0 commit comments