Closed denyskorolkov closed 6 years ago
Hi @denyskorolkov, watch
is not currently supported for building with tests. watch
uses webpack dev server that builds bundles in memory and not physical files that are required to run the tests.
Hi @agubler, I would like to use the next combination:
This combination may help me to see the live test result of my code in a browser without the need to run dojo test
every time. Maybe do you know a more appropriate solution?
@denyskorolkov at the moment using cli-build-webpack
, dojo build -t
will need to be re-run in order to see the results of code changes when running tests in the browser.
However we are working on a new package, cli-build-app
, which will support watching and building tests and is scheduled to be released for the next beta (beta5).
@agubler Thanks for the information. I will be tracking your progress with huge interest.
Hey @denyskorolkov, we've released @dojo/cli-build-app@0.1.0
(compatible with @dojo/cli-test-intern@0.4.0
) that will be part of the upcoming beta5
release. This will allow building the tests under watch so you will be able to run the tests in the browser without having to re-run the build every time!
The command to build the tests on a watch is:
dojo build --mode test --watch
Thanks, @agubler. I've tried and it works but I have a question. Should I run web server separately or not? Now I run dojo build --mode test --watch
and npx intern serveOnly
Hey @denyskorolkov, at the moment you will need to run a web server separately (as you've been doing) from the root of the project as currently --serve
serves the output/test
.
We will open a new issue on cli-build-app
to consider serving from the project root or disabling serve for the test mode entirely.
I hope that helps, thanks!
Bug
dojo build -t -w
doesn't work. Separately both (dojo build -w
&dojo build -t
) work correctly.Expected behavior:
Update files in the _build directory when they changed in src, tests directories.
Actual behavior:
The _build directory wasn't created in the root.