arlac77 / browser-ava Goto Github PK
View Code? Open in Web Editor NEWrun ava test in the browser
License: BSD 2-Clause "Simplified" License
run ava test in the browser
License: BSD 2-Clause "Simplified" License
Something there : v1.1.0...v1.2.0
Make Firefox run slower.
As a consequence, this test was passing and now fail :
import test from 'ava';
async function timeTrack(arrayFuncAndParams,timeout){
return Promise.race([
new Promise(resolve => setTimeout(
()=>resolve({ms:timeout,params:arrayFuncAndParams,timeout:true}),
timeout
)),
new Promise(async resolve=>{
const startTime = Date.now();
const func = arrayFuncAndParams[0];
const params = arrayFuncAndParams.slice(1);
const res = await func(...params);
const endTime = Date.now();
const elapsed = endTime - startTime;
resolve({ms:elapsed,params:arrayFuncAndParams,result:res});
})]
);
}
test('pingTracker give time elapsed', async t => {
await sleep(1); // in some test environnement this fix latency bug.
const mockedFunc = async (first,second)=>{await sleep(second);return first};
const firstParameter = 'finalResult';
const secondParameter = 11;
const toCall = [mockedFunc,firstParameter,secondParameter];
const timeout = 1000;
const result = await timeTrack(toCall,timeout);
t.is(result.result,firstParameter);
t.is(result.params[1],firstParameter);
t.regex(result.ms.toString(),/1[0-9]/);
});
PS : I run it with browser-ava **.test.mjs --chromium --firefox
reload an re execute tests when test or imported code has changed on disk
Support headless modifier in browser names as
testcafe does it
browser-ava --browser firefox:headless test cases
Now failed test are shown with console.log, and that don't look explicitly failed.
The best for me would be to see the error even without having to open the console.
x tests passed
y failed tests
z test skipped
Is your work based on this ?
https://github.com/avajs/ava/pull/3086/files
executing
browser-ava tests/fixtures/tests/second-test.mjs
results in
SyntaxError: Invalid regular expression: invalid flags
If i already have something using the 8080 port, browser-ava don't switch to another port, but loudly fail to launch.
allow running test in an other browser than chromium (firefox, edge, opera...)
When BigInt values are involved the following error occurs:
Unhandled Promise Rejection: TypeError: JSON.stringify cannot serialize BigInt.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.