-
-
Notifications
You must be signed in to change notification settings - Fork 207
feat(custom-esbuild): add unit-test builder
#1935
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
Open
th0r
wants to merge
16
commits into
just-jeb:master
Choose a base branch
from
th0r:add-unit-test-to-custom-esbuild
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
67ab831
feat(custom-esbuild): add `unit-test` builder
th0r a97c8d9
Use correct versions of Angular deps in all packages to avoid incompa…
th0r 9df6232
Properly handle normalized `browsers` empty array
th0r 569eeb4
Use fixed version of `@types/dateformat` as v5.0.3 leads to a TS error
th0r f997964
Add tests for the `custom-esbuild:unit-test` builder
th0r d9c5412
Upgrade `cypress` to v15.3.0
th0r f5b8594
Rollback deps update for `bazel` package
th0r 6fb2041
chore(deps): update bazel-example to Angular CLI 20
th0r 2e77f6d
Remove `console.log`
th0r 0de68c1
Rollback deps update for the `common` package
th0r 14f765c
Rollback deps update for the `custom-webpack` package
th0r 68a1a9f
Rollback deps update for the `jest` package
th0r 7a71eae
Rollback deps update for the `timestamp` package
th0r dcb7e01
Rollback deps update for unrelated example apps
th0r 45083f7
Add `--no-watch` flag to CI unit tests
th0r b976f36
Fix some deps versions
th0r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
examples/custom-esbuild/sanity-esbuild-app-esm/karma.conf.cjs
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 32 additions & 9 deletions
41
examples/custom-esbuild/sanity-esbuild-app-esm/src/app/app.component.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,46 @@ | ||
| import { TestBed, waitForAsync } from '@angular/core/testing'; | ||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
| import { AppComponent } from './app.component'; | ||
|
|
||
| describe('AppComponent', () => { | ||
| beforeEach(waitForAsync(() => { | ||
| TestBed.configureTestingModule({ | ||
| let fixture: ComponentFixture<AppComponent>; | ||
| let appElem: HTMLElement; | ||
|
|
||
| beforeEach(async () => { | ||
| await TestBed.configureTestingModule({ | ||
| imports: [AppComponent], | ||
| }).compileComponents(); | ||
| })); | ||
|
|
||
| fixture = TestBed.createComponent(AppComponent); | ||
| fixture.detectChanges(); | ||
|
|
||
| appElem = fixture.debugElement.nativeElement; | ||
| }); | ||
|
|
||
| it('should create the app', () => { | ||
| const fixture = TestBed.createComponent(AppComponent); | ||
| const app = fixture.debugElement.componentInstance; | ||
| expect(app).toBeTruthy(); | ||
| }); | ||
|
|
||
| it(`should have as title 'sanity-esbuild-app-esm'`, () => { | ||
| const app = fixture.debugElement.componentInstance; | ||
| expect(app.title).toEqual('sanity-esbuild-app-esm (compilation provided)'); | ||
| }); | ||
|
|
||
| it('should render title in a h1 tag', () => { | ||
| const fixture = TestBed.createComponent(AppComponent); | ||
| fixture.detectChanges(); | ||
| const compiled = fixture.debugElement.nativeElement; | ||
| expect(compiled.querySelector('h1').textContent).toContain('sanity-esbuild-app-esm'); | ||
| expect(appElem.querySelector('h1')!.textContent).toContain( | ||
| 'sanity-esbuild-app-esm (compilation provided)' | ||
| ); | ||
| }); | ||
|
|
||
| it('should render subtitle in a h2 tag', () => { | ||
| expect(appElem.querySelector('h2')!.textContent).toContain( | ||
| 'sanity-esbuild-app-esm subtitle (compilation provided)' | ||
| ); | ||
| }); | ||
|
|
||
| it('should render titleByOption in a h3 tag', () => { | ||
| expect(appElem.querySelector('h3')!.textContent).toContain( | ||
| 'sanity-esbuild-app-esm optionTitle (compilation provided)' | ||
| ); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.