webdriverio-community/wdio-html-reporter

Curious as to why is createReport is async

Closed this issue · 3 comments

https://github.com/rpii/wdio-html-reporter/blob/03b44d4e1f7061755cac32765dc1a535a7f5876d/src/reportAggregator.ts#L74

I can't figure out why the createReport method is async. There is nothing in there that uses await that I can see. There are no promises that I can see. Everything looks synchronous.

Also, the way it's being used the onComplete example doesn't seem quite right to me. It looks like it's going to trigger a race condition.

I think it should be probably just be a normal synchronous method. Doing that would also fix the potential onComplete issue.

Please let me know if I just missed something - I just can't figure out why this needs to be async.

rpii commented

OK. Thanks. I'll close my PR.