-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require: [] but long-running in the main process and receives notifications #1769
Comments
Interesting. Do you see this as a side-kick that runs in the main AVA process, without needing a complete programmatic API? The changes in #1722 would come in handy for this. |
I could either use it in the main process or as another process that Ava starts up. I figure it's a little easier to build in the main process though. I don't think it needs much of a programmatic API, maybe that can be expanded upon in the future. It might be interesting to expose some way to start or stop a test run or control what tests are being run based on some other logic. You could build an entire UI around Ava |
Cool, I'm 👍 on this. We'd need to decide what configuration syntax is used to load this module. I think it's fine if it's restricted to configuration files only. It shouldn't be something you do on a one-off basis.
What test results are you interested in? I'm loath to expose AVA's internals, at least at this stage, since I don't think that has necessarily stabilized yet. |
Modified from: #1768 (comment) type Data = {
...,
snapshots: Array<{
name: string,
expected: any,
actual: any,
passed: boolean
}>
};
ava.on('complete', (data: Data) => {
browserWs.send(JSON.stringify(data.failedSnapshots));
}); This is basically all I care about. As long as I can get a list of the snapshots that failed in a way that I could later tell Ava to go update them, that would be enough for me |
That's not really the data we communicate back to the main process. What we can expose now:
The latter is a string. We could also provide the If we also expose a function for resolving the snapshot location based on the test file, you'd have enough to build on top of. |
Could I subscribe to specifically snapshots? |
The work I'm doing with #2478 will allow us to run a worker thread. That said, I don't think our internal events are stable enough to expose to user code. It's been two years since this was opened, I don't think we'll get to this for a while still, so I'm going to close this issue, sorry. |
Description
I'm trying to build some tooling that runs alongside Ava, I can run it as a separate process, but I need to setup my own file watcher and do lots of work to make it work well alongside Ava.
It would be great if Ava exposed a hook to:
Rough draft:
The text was updated successfully, but these errors were encountered: