i am trying to run a test for the flip of the bool value but getting this error while testing it
this is my code
it('Creates a Flipper', async () => {
const switchAccount = anchor.web3.Keypair.generate();
console.log(switchAccount.publicKey.toBase58())
await program.rpc.initialize({
accounts: {
switchAccount: switchAccount.publicKey,
user: provider.wallet.publicKey,
system_program: SystemProgram.programId,
},
signers: [switchAccount],
}); //Create RPC Closed
and this is the eroor i am getting
0 passing (11ms)
2 failing
1) light
Creates a Flipper:
TypeError: Cannot read properties of undefined (reading 'rpc')
at Context.<anonymous> (tests/light.js:16:19)
at processImmediate (node:internal/timers:466:21)