-
-
Notifications
You must be signed in to change notification settings - Fork 2k
chore: fix vitest setup in new docs #4934
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ngrx-io canceled.Built without sensitive environment variables
|
✅ Deploy Preview for ngrx-site-v19 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
I just ran tests on |
|
@markostanimirovic The |
@jdegand Let's then fix #4930 first. I left a comment there. |
@markostanimirovic I added the |
The |
Excluded examples folder from tests in The use of a constructor in place of an |
The examples are referenced within our docs, or offered as a Stackblitz project. |
Need to further investigate issues with
is a workaround. I tried using a zoneless I have started looking at more files for issues. There definitely appears to be a misconfiguration somewhere. The signals tests always timeout. The timeout failures are all related to Update: |
There was an error in the configuration for Changing |
e863de2
to
ad297a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jdegand , I pushed some changes to push this over the finish line.
- force push (no changes) was to trigger the build with our CI activated
- this detected failing tests on all modules because the missing ts-node dependency (I don't know how I missed that in my cleanup) => I re-added the dependency
- the signals were still giving a time-out. I noticed this were cases where there were multiple
expectSnippets
=> I refactored these cases to only compile the snippet once
@timdeschryver The Below is an import {
Component,
Injector,
PLATFORM_ID,
inject,
OnDestroy,
} from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { isPlatformBrowser } from '@angular/common';
import { MenuComponent } from './components/menu.component';
import { MarkdownSymbolLinkComponent } from './components/docs/markdown-symbol-link.component';
import { AlertComponent } from './components/docs/alert.component';
import { CodeExampleComponent } from './components/docs/code-example.component';
import { CodeTabsComponent } from './components/docs/code-tabs.component';
import { StackblitzComponent } from './components/docs/stackblitz.component';
import { FooterComponent } from './components/footer.component';
@Component({
selector: 'ngrx-root',
imports: [
RouterOutlet,
MenuComponent,
MarkdownSymbolLinkComponent,
AlertComponent,
CodeExampleComponent,
StackblitzComponent,
FooterComponent,
],
template: `
<ngrx-menu></ngrx-menu>
<router-outlet></router-outlet>
<ngrx-footer></ngrx-footer>
`,
styles: [
`
:host {
display: block;
position: relative;
width: calc(100% - 270px);
left: 270px;
@media only screen and (max-width: 1280px) {
width: 100%;
left: 0;
}
}
ngrx-menu {
position: fixed;
top: 0;
left: 0;
}
`,
],
})
export class AppComponent implements OnDestroy {
private isAlive = true;
private injector = inject(Injector);
private platformId = inject(PLATFORM_ID);
constructor() {
if (isPlatformBrowser(this.platformId)) {
this.installCustomElements();
}
}
ngOnDestroy(): void {
this.isAlive = false;
}
async installCustomElements() {
if (!this.isAlive) return;
const { createCustomElement } = await import('@angular/elements');
if (!this.isAlive) return;
const symbolLinkElement = createCustomElement(MarkdownSymbolLinkComponent, {
injector: this.injector,
});
customElements.define('ngrx-docs-symbol-link', symbolLinkElement);
if (!this.isAlive) return;
const alertElement = createCustomElement(AlertComponent, {
injector: this.injector,
});
customElements.define('ngrx-docs-alert', alertElement);
if (!this.isAlive) return;
const codeExampleElement = createCustomElement(CodeExampleComponent, {
injector: this.injector,
});
customElements.define('ngrx-code-example', codeExampleElement);
if (!this.isAlive) return;
const codeTabsElement = createCustomElement(CodeTabsComponent, {
injector: this.injector,
});
customElements.define('ngrx-code-tabs', codeTabsElement);
if (!this.isAlive) return;
const stackblitzElement = createCustomElement(StackblitzComponent, {
injector: this.injector,
});
customElements.define('ngrx-docs-stackblitz', stackblitzElement);
}
} |
@timdeschryver I updated the app component and changed the |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #4917
Closes #4918
Closes #4930
What is the new behavior?
Tests will run from the
www
folder (npx nx run www:test
). There is a warning fromtsconfig.spec.json
file about missing types fromvitest
, but this doesn't prevent tests from running. I've tried many different changes and this never goes away. The npm packages got updated when I ran an analog command to regenerate the files.Does this PR introduce a breaking change?
Other information