trying bigget timeout

This commit is contained in:
Pavel Murygin 2022-02-22 20:38:25 +03:00
parent 1d23def404
commit c239be12f2
9 changed files with 55 additions and 58 deletions

View File

@ -3,29 +3,28 @@ import http from 'http';
import path from 'path';
const port = 3001;
const uri = `http://localhost:${port}/`
const uri = `http://localhost:${port}/`;
const publicPath = path.join(__dirname, '../../build/');
console.log(publicPath);
const server = http.createServer((request, response) => {
return handler(request, response, {
public: publicPath
public: publicPath,
});
})
});
const startServer = async () => {
return new Promise((resolve: any) => {
server.listen(port, resolve);
})
}
});
};
const stopServer = async () => {
return new Promise((resolve: any) => {
server.close(resolve);
})
}
});
};
describe('smoke test', () => {
beforeAll(startServer);
@ -57,8 +56,8 @@ describe('smoke test', () => {
console.log('waiting for result to appear...');
const sizeEl = await page.waitForSelector('#file-size');
const size = await sizeEl?.evaluate(x => x.textContent);
const size = await sizeEl?.evaluate((x) => x.textContent);
expect(size).toBe("144804");
}, 10000);
expect(size).toBe('144804');
}, 15000);
});

View File

@ -30,5 +30,5 @@ describe('smoke test', () => {
'Hi, Jake',
'Bye, Jake',
]);
}, 10000);
}, 15000);
});

View File

@ -17,5 +17,5 @@ describe('smoke test', () => {
result: expect.any(Number),
success: true,
});
}, 10000);
}, 15000);
});

View File

@ -3,29 +3,28 @@ import http from 'http';
import path from 'path';
const port = 3000;
const uri = `http://localhost:${port}/`
const uri = `http://localhost:${port}/`;
const publicPath = path.join(__dirname, '../../build/');
console.log(publicPath);
const server = http.createServer((request, response) => {
return handler(request, response, {
public: publicPath
public: publicPath,
});
})
});
const startServer = async () => {
return new Promise((resolve: any) => {
server.listen(port, resolve);
})
}
});
};
const stopServer = async () => {
return new Promise((resolve: any) => {
server.close(resolve);
})
}
});
};
describe('smoke test', () => {
beforeAll(startServer);
@ -48,6 +47,6 @@ describe('smoke test', () => {
console.log('getting the content of price div...');
const content = await elem?.evaluate((x) => x.textContent);
expect(content).toMatch("The price is:")
}, 10000);
expect(content).toMatch('The price is:');
}, 15000);
});

View File

@ -3,29 +3,28 @@ import http from 'http';
import path from 'path';
const port = 3000;
const uri = `http://localhost:${port}/`
const uri = `http://localhost:${port}/`;
const publicPath = path.join(__dirname, '../../build/');
console.log(publicPath);
const server = http.createServer((request, response) => {
return handler(request, response, {
public: publicPath
public: publicPath,
});
})
});
const startServer = async () => {
return new Promise((resolve: any) => {
server.listen(port, resolve);
})
}
});
};
const stopServer = async () => {
return new Promise((resolve: any) => {
server.close(resolve);
})
}
});
};
describe('smoke test', () => {
beforeAll(startServer);
@ -49,5 +48,5 @@ describe('smoke test', () => {
const content = await elem?.evaluate((x) => x.textContent);
expect(content?.length).toBeGreaterThan(10);
}, 10000);
}, 15000);
});

View File

@ -10,5 +10,5 @@ describe('smoke test', () => {
expect(console.log).toHaveBeenNthCalledWith(1, 'Hello, world!');
expect(console.log).toHaveBeenNthCalledWith(2, 'Wealth awaits you very soon.');
expect(console.log).toHaveBeenNthCalledWith(3, 'The relay time is: ', expect.anything());
}, 10000);
}, 15000);
});

View File

@ -8,5 +8,5 @@ describe('smoke test', () => {
const res = await demoCalculation();
expect(res).toBe(7);
}, 10000);
}, 15000);
});

View File

@ -4,28 +4,28 @@ import http from 'http';
import path from 'path';
const port = 3000;
const uri = `http://localhost:${port}/`
const uri = `http://localhost:${port}/`;
const publicPath = path.join(__dirname, '../../build/');
console.log(publicPath);
const server = http.createServer((request, response) => {
return handler(request, response, {
public: publicPath
public: publicPath,
});
})
});
const startServer = async () => {
return new Promise((resolve: any) => {
server.listen(port, resolve);
})
}
});
};
const stopServer = async () => {
return new Promise((resolve: any) => {
server.close(resolve);
})
}
});
};
const peerIdLength = '12D3KooWM2CYSHefG6KPKbYFAgsbPh8p6b8HYHc6VNkge2rPtYv5'.length;
@ -100,5 +100,5 @@ describe('smoke test', () => {
expect(page1Message).toBe('Hello back to you, ' + peerRelay1.peerId);
expect(page2Message).toBe('Hello from: ' + peerRelay1.peerId);
}, 10000);
}, 15000);
});

View File

@ -4,28 +4,28 @@ import http from 'http';
import path from 'path';
const port = 3000;
const uri = `http://localhost:${port}/`
const uri = `http://localhost:${port}/`;
const publicPath = path.join(__dirname, '../../build/');
console.log(publicPath);
const server = http.createServer((request, response) => {
return handler(request, response, {
public: publicPath
public: publicPath,
});
})
});
const startServer = async () => {
return new Promise((resolve: any) => {
server.listen(port, resolve);
})
}
});
};
const stopServer = async () => {
return new Promise((resolve: any) => {
server.close(resolve);
})
}
});
};
const peerIdLength = '12D3KooWM2CYSHefG6KPKbYFAgsbPh8p6b8HYHc6VNkge2rPtYv5'.length;
const loadApp = async (page: Page) => {
@ -99,5 +99,5 @@ describe('smoke test', () => {
expect(page1Message).toBe('Hello back to you, ' + peerRelay1.peerId);
expect(page2Message).toBe('Hello from: ' + peerRelay1.peerId);
}, 10000);
}, 15000);
});