ianwalter / bff Goto Github PK
View Code? Open in Web Editor NEWYour friendly test framework
Home Page: https://bff.ianwalter.dev/
License: Other
Your friendly test framework
Home Page: https://bff.ianwalter.dev/
License: Other
To help find flaky tests. It could look like
const { test, times } = require('@ianwalter/bff')
test('click handler', times(10), ({ expect }) => {
let testValue = 'foo'
const a = document.createElement('a')
a.onclick = () => (testValue = 'bar')
a.click()
expect(testValue).toBe('bar')
})
``
That runs something with run context, so like:
test('something', async ({ expect, browser, failure }) => {
failure(async () => await browser.pause(99999))
for (const button of buttons) {
const element = await browser.$(button)
expect(await button.getText()).toBe('Submit')
}
})
Allow options some
(default) and every
.
So that the snapshots are compatible with snapshot IDE plugins.
*pptr.js
files as puppeteer-based tests by defaultfileContext.isPuppeteer
is true, compile the test file together with the browser file using Webpack and save it to a tmp file. Then launch puppeteer to run registration in a browser and return the evaluation of a registration call.I guess you could hack something together with a plugin and a registration hook, but an official API would be cool.
And allow the plugins to register hooks with matching method names on modules.export
Add something like let plugin; try { plugin = require(file) } catch (err) {}; plugin = plugin || require(resolve(file))
Add Modifiers and Tags sub-sections and Hooks section.
Still try to run after hooks on first sigint since they will likely be used for cleanup.
Fail test if there is an error AND evaluation returns undefined.
That can add to test context and modify test name.
And a —tags, -t option
Like test.skip
, test.tags
, and/or test.only
.
Registration pool is not really being terminated when it should be.
Default to a no-op function for the test function if not provided so you can do something like:
test.skip('TODO')
To allow control over the max amount of workers in the worker pool.
Might be a good idea for a modifier as well.
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.