Created
March 9, 2018 20:27
-
-
Save sneljo1/5b81cab1690d2479f071e080ee40e7f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 be able to add car", async () => { | |
const stub = new ChaincodeMockStub("MyMockStub", chaincode); | |
const car0 = { | |
'make': 'Toyota', | |
'model': 'Prius', | |
'color': 'blue', | |
'owner': 'Tomoko', | |
'docType': 'car' | |
}; | |
const car = await chaincode.queryCar(stub, ["CAR0"]) | |
expect(car).to.deep.equal(car0); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment