massive-oss / MassiveUnit

munit is a cross-platform unit testing framework for Haxe. Utilises metadata markup for test cases and includes tools for generating, compiling and running test cases from the command line.
Other
180 stars 56 forks source link

Is it possible not to stop localserver? #175

Open CrazyFlasher opened 4 years ago

CrazyFlasher commented 4 years ago

When I run haxelib run munit test test.hxml -js Local server starts, does tests and stop. But I want to refresh page to enable breakpoints in tests. Is it possible not to stop localserver? Or are there any other ways to enable breakpoints for js build?

elsassph commented 4 years ago

My usual trick is to edit TestMain (which isn't auto-regenerated) and change:

runner.run(suites);

with:

js.Browser.setTimeout(function() {
    js.Lib.debug(); // breakpoint here
    runner.run(suites);
}, 5000); // give me 5s to open devtools
CrazyFlasher commented 4 years ago

Small correction :)

                js.Browser.window.setTimeout(function() {
            js.Lib.debug(); // breakpoint here
            runner.run(suites);
        }, 5000);
CrazyFlasher commented 4 years ago

For some reason source maps are not generated. haxelib run munit test test.hxml -js -debug - is it correct command for debugging source for js?

elsassph commented 4 years ago

Maybe -debug should be inside test.hxml

CrazyFlasher commented 4 years ago

Well, Chome shows that source maps are detected, but I cannot see them, and code is in ugly JS :) image

elsassph commented 4 years ago

Hmm ok it's a bug: the sourcemap file isn't copied over to the temporary server. You may rise a ticket for that.