skip auction tests
This commit is contained in:
parent
c3fa657687
commit
b76f52013b
@ -1,39 +1,47 @@
|
|||||||
import {cliTest,createAuthority} from './helper';
|
import {cliTest,createAuthority, getAuctionId} from './helper';
|
||||||
|
|
||||||
jest.setTimeout(3 * 60 * 1000);
|
jest.setTimeout(3 * 60 * 1000);
|
||||||
|
|
||||||
const args= "auction ";
|
const args= "auction ";
|
||||||
const quantity=25000000
|
const quantity=25000000
|
||||||
const type="aphoton"
|
const type="aphoton"
|
||||||
|
const name="laconic-auction"
|
||||||
|
|
||||||
|
|
||||||
var auctionId: string;
|
var auctionId: string;
|
||||||
var filepath: string;
|
var filepath: string;
|
||||||
|
|
||||||
describe("test auction",() => {
|
if (!process.env.TEST_AUCTIONS_ENABLED) {
|
||||||
beforeAll(async () => {
|
// Required as jest complains if file has no tests.
|
||||||
// get auction id
|
test('skipping auction tests', () => {});
|
||||||
auctionId = createAuthority("laconic-auction")
|
} else {
|
||||||
|
describe("test auction",() => {
|
||||||
|
beforeAll(async () => {
|
||||||
|
// reserve authority
|
||||||
|
createAuthority(name)
|
||||||
|
auctionId = getAuctionId(name)
|
||||||
|
});
|
||||||
|
|
||||||
|
it("bid commit",async ()=>{
|
||||||
|
const resp=cliTest(args+"bid commit "+auctionId+" "+quantity+" "+type);
|
||||||
|
expect(resp).toBeDefined;
|
||||||
|
|
||||||
|
filepath = resp.reveal_file
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Wait for reveal phase.", (done) => {
|
||||||
|
setTimeout(done, 60 * 1000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("bid reveal", async ()=>{
|
||||||
|
const resp=cliTest(args+"bid reveal "+auctionId+" "+filepath);
|
||||||
|
expect(resp).toBeDefined;
|
||||||
|
});
|
||||||
|
|
||||||
|
it("get auction",async ()=>{
|
||||||
|
const resp=cliTest(args+"get "+auctionId);
|
||||||
|
expect(resp).toBeDefined;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
it("bid commit",async ()=>{
|
|
||||||
const resp=cliTest(args+"bid commit "+auctionId+" "+quantity+" "+type);
|
|
||||||
expect(resp).toBeDefined;
|
|
||||||
|
|
||||||
filepath = "."+resp.substring(resp.indexOf("/out/"))
|
|
||||||
});
|
|
||||||
|
|
||||||
it("Wait for reveal phase.", (done) => {
|
|
||||||
setTimeout(done, 60 * 1000);
|
|
||||||
});
|
|
||||||
|
|
||||||
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;
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user