You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 25, 2020. It is now read-only.
Hi,
I'm trying to test my contract created by IBM blockchain platform VSCIDE extension. My contract is written in typescript. Now in order to test my contract I've used the following code:
import { MyContract } from '../src/my-contract';
import { ChaincodeMockStub, Transform } from "@theledger/fabric-mock-stub";
// You always need your chaincode so it knows which chaincode to invoke on
const chaincode = new MyContract();
describe('Test MyChaincode', () => {
it("Should init without issues", async () => {
const mockStub = new ChaincodeMockStub("MyMockStub", chaincode);
// Your test code
});
});
and I get 2 errors. first I get "Unexpected token import", and second there is an error with the below line:
const mockStub = new ChaincodeMockStub("MyMockStub", chaincode);
says "Argument of type "MyContract" is not assignable to parameter of type "ChaincodeInterface" ".