-
Notifications
You must be signed in to change notification settings - Fork 20
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
Bazel testing #6
base: master
Are you sure you want to change the base?
Conversation
* build: ignore bazel branch on Travis (#4) CircleCI will be used instead * Introduce bazel Can now `bazel build //...` to compile the code with ngc. * code review feedback
f9fe4c0
to
db87a0b
Compare
@alexeagle ok, made some adjustments based on your angular-bazel-example and now test run more or less. I didn't have this line // TODO(alexeagle): this helper should be in @angular/platform-browser-dynamic/testing
try {
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
} catch {
// Ignore exceptions when calling it multiple times.
} ...which you already commented should be done in the proper Angular testing module. There's just one thing though which makes test not pass properly. It's the fact that the Is this a known issue or did I miss some step in the setup? |
Right now the tests assume you use AOT testing, like in my example, meaning the test component loads the compiled factory. In this scenario there is no need to load css or html in the browser because it's all been run through ngc. I've discussed with @jelbourn about adding the ability for |
@vikerman is there some public doc about how to convert your Angular tests to the AOT style? |
I understand. In fact, I've seen you're importing the factory class in the example.
Makes sense. But is the idea to add a compilation step somehow? Otherwise it would mean that you have to rewrite/adjust your existing tests whenever you switch to Bazel. |
For this repo, you're writing new tests so I believe the new style is preferred. |
I understand.
Oh true that as well. It's also a common scenario. Just updated the branch, now I'm getting a weird error that it cannot load the Btw, did you succeed with |
If you are missing I am still waiting for @IgorMinar to approve angular/angular#22221 so we can use |
Thought that as well. But the Also it looks for
Shouldn't that be |
Ah, if Karma is looking for ngsummary files at runtime, that suggests there
is still usage of platform-browser-dynamic, meaning the compiler is still
running in the browser.
…On Fri, Feb 23, 2018 at 8:22 AM Juri Strumpflohner ***@***.***> wrote:
If you are missing node_modules//*.ngsummary.json this means the ngc in
the postinstall step did not do its job. Under Bazel we assume that every
library has ngc compiler metadata, including those you fetched from npm.
Thought that as well. But the ngc compiler seems to have done its job. I
see *.ngfactory.js files as well as *.ngsummary.json files in
@angular/common. It's more like they're not properly served to the web
server. I'm currently trying to figure out the difference to your example
repo, where it seems to work 🤔.
Also it looks for *.ngsummary.js.
HeadlessChrome 65.0.3325 (Mac OS X 10.11.6) ERROR: 'There is no timestamp for ***@***.***/common/common.ngsummary.js!'
Shouldn't that be ngfactory.js?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC5IxBalqNAq_f3HBlORwNaqR8GlBuoks5tXuXZgaJpZM4SOdwy>
.
|
Hmm...I removed the imports from However that didn't change much. Any idea what else could I be missing? The error is still the same, as if I hadn't changed anything. |
This is a WIP of adding a unit test to the setup, but doesn't yet work.
Getting some errors about loading RxJS which remember me the bad old RequireJS times 😅