delete-me/test/auction.test.ts

33 lines
846 B
TypeScript
Raw Normal View History

2023-03-26 20:12:52 +00:00
import {cliTest,createAuthority} from './helper';
2023-03-24 11:32:38 +00:00
2023-03-26 20:12:52 +00:00
const args= "auction ";
const quantity=25000000
const type="aphoton"
var auctionId: string;
var filepath: string;
2023-03-24 11:32:38 +00:00
describe("test auction",() => {
2023-03-26 20:12:52 +00:00
beforeAll(async () => {
// get auction id
auctionId = createAuthority("laconic-auction")
});
2023-03-24 11:32:38 +00:00
it("bid commit",async ()=>{
2023-03-26 20:12:52 +00:00
const resp=JSON.parse(cliTest(args+"bid commit "+auctionId+" "+quantity+" "+type));
expect(resp).toBeDefined;
filepath = resp.substring(resp.indexOf("./out"))
});
it("bid reveal", async ()=>{
const resp=JSON.parse(cliTest(args+"bid reveal "+auctionId+" "+filepath));
expect(resp).toBeDefined;
});
it("get auction",async ()=>{
const resp=JSON.parse(cliTest(args+"get "+auctionId));
expect(resp).toBeDefined;
2023-03-24 11:32:38 +00:00
});
});