@@ -4,7 +4,7 @@ import { expect, test } from 'vitest'
44import { actions } from './actions.js'
55
66test ( 'default' , async ( ) => {
7- const result = await actions ( ) . run ( {
7+ const result = await actions ( ) . run ?. ( {
88 contracts : [
99 {
1010 name : 'erc20' ,
@@ -19,11 +19,11 @@ test('default', async () => {
1919 outputs : [ ] ,
2020 } )
2121
22- expect ( result . imports ) . toMatchInlineSnapshot ( `
22+ expect ( result ? .imports ) . toMatchInlineSnapshot ( `
2323 "import { createReadContract, createWriteContract, createSimulateContract, createWatchContractEvent } from '@wagmi/core/codegen'
2424 "
2525 ` )
26- expect ( result . content ) . toMatchInlineSnapshot ( `
26+ expect ( result ? .content ) . toMatchInlineSnapshot ( `
2727 "/**
2828 * Wraps __{@link readContract}__ with \`abi\` set to __{@link erc20Abi}__
2929 */
@@ -117,7 +117,7 @@ test('default', async () => {
117117} )
118118
119119test ( 'address' , async ( ) => {
120- const result = await actions ( ) . run ( {
120+ const result = await actions ( ) . run ?. ( {
121121 contracts : [
122122 {
123123 name : 'erc20' ,
@@ -133,7 +133,7 @@ test('address', async () => {
133133 outputs : [ ] ,
134134 } )
135135
136- expect ( result . content ) . toMatchInlineSnapshot ( `
136+ expect ( result ? .content ) . toMatchInlineSnapshot ( `
137137 "/**
138138 * Wraps __{@link readContract}__ with \`abi\` set to __{@link erc20Abi}__
139139 */
@@ -227,7 +227,7 @@ test('address', async () => {
227227} )
228228
229229test ( 'legacy hook names' , async ( ) => {
230- const result = await actions ( { getActionName : 'legacy' } ) . run ( {
230+ const result = await actions ( { getActionName : 'legacy' } ) . run ?. ( {
231231 contracts : [
232232 {
233233 name : 'erc20' ,
@@ -243,7 +243,7 @@ test('legacy hook names', async () => {
243243 outputs : [ ] ,
244244 } )
245245
246- expect ( result . content ) . toMatchInlineSnapshot ( `
246+ expect ( result ? .content ) . toMatchInlineSnapshot ( `
247247 "/**
248248 * Wraps __{@link readContract}__ with \`abi\` set to __{@link erc20Abi}__
249249 */
@@ -337,7 +337,7 @@ test('legacy hook names', async () => {
337337} )
338338
339339test ( 'override package name' , async ( ) => {
340- const result = await actions ( { overridePackageName : 'wagmi' } ) . run ( {
340+ const result = await actions ( { overridePackageName : 'wagmi' } ) . run ?. ( {
341341 contracts : [
342342 {
343343 name : 'erc20' ,
@@ -352,7 +352,7 @@ test('override package name', async () => {
352352 outputs : [ ] ,
353353 } )
354354
355- expect ( result . imports ) . toMatchInlineSnapshot ( `
355+ expect ( result ? .imports ) . toMatchInlineSnapshot ( `
356356 "import { createReadContract, createWriteContract, createSimulateContract, createWatchContractEvent } from 'wagmi/codegen'
357357 "
358358 ` )
0 commit comments