@@ -3,6 +3,7 @@ import { describe, expect, it, vi } from 'vitest'
33import * as subject from '../src/vitest-when.ts'
44
55const DEBUG_OPTIONS = { log : false }
6+ const VI_FN_NAME_MATCHER = / (?: v i \. f n \( \) | s p y ) / u
67
78describe ( 'vitest-when debug' , ( ) => {
89 it ( 'debugs a non-stubbed spy' , ( ) => {
@@ -11,7 +12,7 @@ describe('vitest-when debug', () => {
1112 const result = subject . debug ( spy , DEBUG_OPTIONS )
1213
1314 expect ( result ) . toEqual ( {
14- name : 'vi.fn()' ,
15+ name : expect . stringMatching ( VI_FN_NAME_MATCHER ) ,
1516 stubbings : [ ] ,
1617 unmatchedCalls : [ ] ,
1718 description : expect . stringContaining (
@@ -28,7 +29,7 @@ describe('vitest-when debug', () => {
2829 const result = subject . debug ( spy , DEBUG_OPTIONS )
2930
3031 expect ( result ) . toEqual ( {
31- name : 'vi.fn()' ,
32+ name : expect . stringMatching ( VI_FN_NAME_MATCHER ) ,
3233 stubbings : [
3334 {
3435 args : [ 'hello' , 'world' ] ,
@@ -52,7 +53,7 @@ describe('vitest-when debug', () => {
5253 const result = subject . debug ( spy , DEBUG_OPTIONS )
5354
5455 expect ( result ) . toMatchObject ( {
55- name : 'vi.fn()' ,
56+ name : expect . stringMatching ( VI_FN_NAME_MATCHER ) ,
5657 stubbings : [
5758 {
5859 args : [ expect . any ( String ) ] ,
@@ -75,7 +76,7 @@ describe('vitest-when debug', () => {
7576 const result = subject . debug ( spy , DEBUG_OPTIONS )
7677
7778 expect ( result ) . toMatchObject ( {
78- name : 'vi.fn()' ,
79+ name : expect . stringMatching ( VI_FN_NAME_MATCHER ) ,
7980 stubbings : [
8081 {
8182 args : [ expect . any ( String ) ] ,
0 commit comments