travisjeffery / mocha-teamcity-reporter

MIT License
40 stars 48 forks source link

Run in browser solves #41 #43

Closed jamie-sherriff closed 6 years ago

jamie-sherriff commented 6 years ago

Solves #41

@aleksandr-oleynikov let me know if there is anything else you want otherwise ill merge it in.

aleksandr-oleynikov commented 6 years ago

Thank you! It works!

There is only one little opportunity we want to have. I've explained it above.

jamie-sherriff commented 6 years ago

@aleksandr-oleynikov Ah good idea! have added it in. If you can double check it will work with your case. Just make sure a function is bound to the variable customLogFunction

consult mocha.html under test/browser if you want an example

aleksandr-oleynikov commented 6 years ago

I've checked customLogFunction. All works! Thanks a lot!

aleksandr-oleynikov commented 6 years ago

👍

aleksandr-oleynikov commented 6 years ago

We will look forward to merge.

lambda-fairy commented 6 years ago

What was the motivation behind splitting into a separate file? The duplication doesn't feel very nice.

AFAICT it's only process.env that doesn't work. We can extend the existing compatibility code to stub this out instead.

var getProcessEnv = typeof process === 'object' ? function () { return process.env; } : function () { return {} };
jamie-sherriff commented 6 years ago

Certainly not arguing its a terrible idea. It was a quick and easy way to maintain ES5 browser compliance without needing to add in browserify/webpack. Would certainly accept a PR to tidy it up.