Skip to content

Instantly share code, notes, and snippets.

@sneljo1
Created March 9, 2018 20:22
Show Gist options
  • Save sneljo1/ef7ce4376e073d4a9f8712eaab9cf37c to your computer and use it in GitHub Desktop.
Save sneljo1/ef7ce4376e073d4a9f8712eaab9cf37c to your computer and use it in GitHub Desktop.
import { MyChaincode } from '../<path_to_your_chaincode_class>';
import { ChaincodeMockStub, Transform } from "@theledger/fabric-mock-stub";
// You always need your chaincode so it knows which chaincode to invoke on
const chaincode = new MyChaincode();
describe('Test MyChaincode', () => {
it("Should init without issues", async () => {
const mockStub = new ChaincodeMockStub("MyMockStub", chaincode);
// Your test code
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment