File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ pnpm install errx
2020```
2121
2222``` js
23- import { captureRawStackTrace , captureStackTrace , parseStackTrace } from ' errx'
23+ import { captureRawStackTrace , captureStackTrace , parseRawStackTrace } from ' errx'
2424
2525// returns raw string stack trace
2626captureRawStackTrace ()
Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ export function captureRawStackTrace() {
2323export function captureStackTrace ( ) {
2424 const stack = captureRawStackTrace ( )
2525
26- return stack ? parseStackTrace ( stack ) : [ ]
26+ return stack ? parseRawStackTrace ( stack ) : [ ]
2727}
2828
29- export function parseStackTrace ( stacktrace : string ) {
29+ export function parseRawStackTrace ( stacktrace : string ) {
3030 const trace : ParsedTrace [ ] = [ ]
3131 for ( const line of stacktrace . split ( '\n' ) ) {
3232 const parsed = LINE_RE . exec ( line ) ?. groups as Partial < Record < keyof ParsedTrace , string > > | undefined
Original file line number Diff line number Diff line change 11import { fileURLToPath } from 'node:url'
22import { describe , expect , it } from 'vitest'
3- import { captureStackTrace , parseStackTrace } from '../src'
3+ import { captureStackTrace , parseRawStackTrace } from '../src'
44
55describe ( 'errx' , ( ) => {
66 it ( 'works' , ( ) => {
@@ -112,15 +112,15 @@ Error
112112
113113describe ( 'parseStackTrace' , ( ) => {
114114 it ( 'parses vitest' , ( ) => {
115- expect ( parseStackTrace ( vitestTrace ) ) . toMatchFileSnapshot ( '__snapshots__/vitest.json5' )
115+ expect ( parseRawStackTrace ( vitestTrace ) ) . toMatchFileSnapshot ( '__snapshots__/vitest.json5' )
116116 } )
117117 it ( 'parses jiti' , ( ) => {
118- expect ( parseStackTrace ( jitiTrace ) ) . toMatchFileSnapshot ( '__snapshots__/jiti.json5' )
118+ expect ( parseRawStackTrace ( jitiTrace ) ) . toMatchFileSnapshot ( '__snapshots__/jiti.json5' )
119119 } )
120120 it ( 'parses bun' , ( ) => {
121- expect ( parseStackTrace ( bunTrace ) ) . toMatchFileSnapshot ( '__snapshots__/bun.json5' )
121+ expect ( parseRawStackTrace ( bunTrace ) ) . toMatchFileSnapshot ( '__snapshots__/bun.json5' )
122122 } )
123123 it ( 'parses deno' , ( ) => {
124- expect ( parseStackTrace ( denoTrace ) ) . toMatchFileSnapshot ( '__snapshots__/deno.json5' )
124+ expect ( parseRawStackTrace ( denoTrace ) ) . toMatchFileSnapshot ( '__snapshots__/deno.json5' )
125125 } )
126126} )
You can’t perform that action at this time.
0 commit comments