Skip to content

Commit 6ae1363

Browse files
feat: release v13 (#327)
* feat: update to Angular 15 * feat: rename ɵcomponentImports to componentImports BREAKING CHANGE: The render property ɵcomponentImports is not experimental anymore, and is renamed to componentImports BEFORE: ```ts render(ParentComponent, { ɵcomponentImports: [ChildComponent], }); ``` AFTER: ```ts render(ParentComponent, { componentImports: [ChildComponent], }); ``` * docs: update material inputs example (#324) * fix: don't fire router events on render (#325) Closes #318 * fix: don't invoke ngOnChanges when no properties are provided (#326) Closes #323 BREAKING CHANGE: This change is made to have the same behavior as the run time behavior. BEFORE: The `ngOnChanges` lifecycle is always invoked when a component is rendered. AFTER: The `ngOnChanges` lifecycle is only invoked if a component is rendered with `componentProperties`. * feat: add more fine-grained control over inputs and outputs (#328) BREAKING CHANGE: `rerender` expects properties to be wrapped in an object containing `componentProperties` (or `componentInputs` and `componentOutputs` to have a more fine-grained control). BEFORE: ```ts await render(PersonComponent, { componentProperties: { name: 'Sarah' } }); await rerender({ name: 'Sarah 2' }); ``` AFTER: ```ts await render(PersonComponent, { componentProperties: { name: 'Sarah' } }); await rerender({ componentProperties: { name: 'Sarah 2' } }); ``` * feat: add ability to turn off auto detect changes (#329) * chore: update peer dependencies (#330) BREAKING CHANGE: BEFORE: The minimum version of Angular is v14.0.0 AFTER: The minimum version of Angular is v14.1.0 * feat: childComponentOverrides is stable (#338) * fix: invoke changeChanges once on input change (#339) * feat: remove detectChanges in favor of detectChangesOnRender (#341) BREAKING CHANGE: The config property detectChanges is renamed to detectChangesOnRender. BEFORE: ```ts const component = await render(AppComponent, { detectChanges: false }); ``` AFTER: ```ts const component = await render(AppComponent, { detectChangesOnRender: false }); ``` * test: extra tests for ngOnChanges (#342) * test: add test example for harness (#343)
1 parent 63c27e2 commit 6ae1363

30 files changed

+574
-225
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
node-version: ${{ matrix.node-version }}
2929
- name: install
30-
run: npm install
30+
run: npm install --legacy-peer-deps
3131
- name: build
3232
run: npm run build -- --skip-nx-cache
3333
- name: test

apps/example-app-karma/.browserslistrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

apps/example-app-karma/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "example-app-karma",
23
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"projectType": "application",
45
"sourceRoot": "apps/example-app-karma/src",

apps/example-app-karma/src/app/issues/issue-222.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ it('https://github.com/testing-library/angular-testing-library/issues/222 with r
99

1010
expect(screen.getByText('Hello Sarah')).toBeTruthy();
1111

12-
await rerender({ name: 'Mark' });
12+
await rerender({ componentProperties: { name: 'Mark' } });
1313

1414
expect(screen.getByText('Hello Mark')).toBeTruthy();
1515
});

apps/example-app-karma/src/test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,5 @@ beforeEach(() => {
99
jasmine.addMatchers(JasmineDOM);
1010
});
1111

12-
declare const require: any;
13-
1412
// First, initialize the Angular testing environment.
1513
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {});
16-
// Then we find all the tests.
17-
const context = require.context('./', true, /\.spec\.ts$/);
18-
// And load the modules.
19-
context.keys().map(context);

apps/example-app-karma/tsconfig.app.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
55
"types": [],
6-
"allowJs": true
6+
"allowJs": true,
7+
"target": "ES2022",
8+
"useDefineForClassFields": false
79
},
810
"files": ["src/main.ts", "src/polyfills.ts"],
911
"include": ["src/**/*.d.ts"],

apps/example-app-karma/tsconfig.spec.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "./out-tsc/spec",
5-
"types": ["jasmine", "node", "@testing-library/jasmine-dom"]
5+
"types": ["jasmine", "node", "@testing-library/jasmine-dom"],
6+
"target": "ES2022",
7+
"useDefineForClassFields": false
68
},
79
"files": ["src/test.ts", "src/polyfills.ts"],
810
"include": ["**/*.spec.ts", "**/*.d.ts"]

apps/example-app/.browserslistrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

apps/example-app/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "example-app",
23
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"projectType": "application",
45
"sourceRoot": "apps/example-app/src",
@@ -75,7 +76,7 @@
7576
"options": {
7677
"jestConfig": "apps/example-app/jest.config.ts"
7778
},
78-
"outputs": ["coverage/"]
79+
"outputs": ["{workspaceRoot}/coverage/"]
7980
}
8081
},
8182
"tags": []

apps/example-app/src/app/app-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const routes: Routes = [
9595
];
9696

9797
@NgModule({
98-
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
98+
imports: [RouterModule.forRoot(routes, {})],
9999
exports: [RouterModule],
100100
})
101101
export class AppRoutingModule {}

0 commit comments

Comments
 (0)