Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: testing-library/angular-testing-library
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v10.6.0
Choose a base ref
...
head repository: testing-library/angular-testing-library
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v10.7.0
Choose a head ref
  • 6 commits
  • 35 files changed
  • 3 contributors

Commits on Apr 25, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1c55766 View commit details

Commits on May 7, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d706f84 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    68924e4 View commit details

Commits on May 15, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e6d2e84 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    aa98eac View commit details
  3. Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    aa5584e View commit details
Showing with 152 additions and 136 deletions.
  1. +9 −0 .all-contributorsrc
  2. +4 −6 .eslintrc.json
  3. +15 −4 .github/workflows/ci.yml
  4. +0 −32 .github/workflows/release.yml
  5. +10 −7 README.md
  6. +40 −13 angular.json
  7. +2 −3 apps/example-app/.eslintrc.json
  8. +1 −1 apps/example-app/src/app/examples/09-router.ts
  9. +1 −1 apps/example-app/src/app/issues/issue-106.spec.ts
  10. +1 −1 apps/example-app/src/environments/environment.ts
  11. +1 −1 apps/example-app/src/polyfills.ts
  12. +1 −1 nx.json
  13. +21 −20 package.json
  14. +2 −2 projects/jest-utils/.eslintrc.json
  15. +4 −3 projects/jest-utils/tests/create-mock.spec.ts
  16. +2 −2 projects/testing-library/.eslintrc.json
  17. +5 −5 projects/testing-library/package.json
  18. +2 −1 projects/testing-library/src/lib/testing-library.ts
  19. +2 −2 projects/testing-library/tests/auto-cleanup.spec.ts
  20. +1 −1 projects/testing-library/tests/config.spec.ts
  21. +3 −3 projects/testing-library/tests/debug.spec.ts
  22. +1 −1 projects/testing-library/tests/detect-changes.spec.ts
  23. +1 −1 projects/testing-library/tests/find-by.spec.ts
  24. +1 −1 projects/testing-library/tests/fire-event.spec.ts
  25. +1 −1 projects/testing-library/tests/issues/188.spec.ts
  26. +1 −1 projects/testing-library/tests/issues/67.spec.ts
  27. +1 −1 projects/testing-library/tests/navigate.spec.ts
  28. +3 −3 projects/testing-library/tests/providers/component-provider.spec.ts
  29. +3 −3 projects/testing-library/tests/providers/module-provider.spec.ts
  30. +5 −7 projects/testing-library/tests/render-template.spec.ts
  31. +2 −2 projects/testing-library/tests/render.spec.ts
  32. +3 −3 projects/testing-library/tests/rerender.spec.ts
  33. +1 −1 projects/testing-library/tests/wait-for-element-to-be-removed.spec.ts
  34. +1 −1 projects/testing-library/tests/wait-for.spec.ts
  35. +1 −1 release.config.js
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -207,6 +207,15 @@
"code",
"ideas"
]
},
{
"login": "amitmiran137",
"name": "Amit Miran",
"avatar_url": "https://avatars.githubusercontent.com/u/47772523?v=4",
"profile": "https://github.com/amitmiran137",
"contributions": [
"infra"
]
}
],
"contributorsPerLine": 7,
10 changes: 4 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -5,9 +5,6 @@
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {
"project": ["/tsconfig.*?.json"]
},
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
@@ -49,7 +46,7 @@
],
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/quotes": ["error", "single"],
"@typescript-eslint/quotes": "off",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/no-explicit-any": "off",
"arrow-body-style": "error",
@@ -107,9 +104,10 @@
},
{
"files": ["*.spec.ts"],
"extends": ["plugin:testing-library/angular", "plugin:jest-dom/recommended"],
"extends": ["plugin:jest/recommended"],
"rules": {
"testing-library/prefer-explicit-assert": "error"
"jest/no-done-callback": "off",
"jest/expect-expect": "off"
}
},
{
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
name: ci

on: pull_request
on:
push:
pull_request:
branches:
- main

jobs:
build_and_test:
build_test_release:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [12, 14, 16]
node-version: [12, 14]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: use Node.js ${{ matrix.node-version }}
- name: use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
@@ -21,3 +26,9 @@ jobs:
run: npm run build -- --skip-nx-cache
- name: test
run: npm run test -- --ci --code-coverage
- name: Release
if: github.repository == 'testing-library/angular-testing-library' && github.ref == 'refs/heads/main' && matrix.node-version == 14 && matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
32 changes: 0 additions & 32 deletions .github/workflows/release.yml

This file was deleted.

17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
height="80"
width="80"
alt="hedgehog"
src="https://raw.githubusercontent.com/testing-library/angular-testing-library/master/other/hedgehog.png"
src="https://raw.githubusercontent.com/testing-library/angular-testing-library/main/other/hedgehog.png"
/>
</a>

@@ -43,7 +43,7 @@ practices.</p>
<img
width="500"
alt="TestingJavaScript.com Learn the smart, efficient way to test any JavaScript application."
src="https://raw-hub.myxuebi.top/testing-library/react-testing-library/master/other/testingjavascript.jpg"
src="https://raw-hub.myxuebi.top/testing-library/react-testing-library/main/other/testingjavascript.jpg"
/>
</a>
</div>
@@ -139,7 +139,7 @@ describe('Counter', () => {
});
```

[See more examples](https://github.com/testing-library/angular-testing-library/tree/master/apps/example-app/src/app/examples)
[See more examples](https://github.com/testing-library/angular-testing-library/tree/main/apps/example-app/src/app/examples)

## Installation

@@ -211,6 +211,9 @@ Thanks goes to these people ([emoji key][emojis]):
<td align="center"><a href="https://github.com/the-ult"><img src="https://avatars.githubusercontent.com/u/4863062?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Arjen</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=the-ult" title="Code">💻</a></td>
<td align="center"><a href="https://lacolaco.net"><img src="https://avatars.githubusercontent.com/u/1529180?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Suguru Inatomi</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=lacolaco" title="Code">💻</a> <a href="#ideas-lacolaco" title="Ideas, Planning, & Feedback">🤔</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/amitmiran137"><img src="https://avatars.githubusercontent.com/u/47772523?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amit Miran</b></sub></a><br /><a href="#infra-amitmiran137" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
@@ -270,8 +273,8 @@ Links:

[npm]: https://www.npmjs.com/
[node]: https://nodejs.org
[build-badge]: https://circleci.com/gh/testing-library/angular-testing-library/tree/master.svg?style=shield
[build]: https://circleci.com/gh/testing-library/angular-testing-library/tree/master
[build-badge]: https://circleci.com/gh/testing-library/angular-testing-library/tree/main.svg?style=shield
[build]: https://circleci.com/gh/testing-library/angular-testing-library/tree/main
[coverage]: https://codecov.io/github/testing-library/angular-testing-library
[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/angular-testing-library.svg?style=flat-square
[version-badge]: https://img.shields.io/npm/v/@testing-library/angular.svg?style=flat-square
@@ -281,12 +284,12 @@ Links:
[discord-badge]: https://img.shields.io/discord/723559267868737556.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square
[discord]: https://discord.gg/testing-library
[license-badge]: https://img.shields.io/npm/l/@testing-library/angular.svg?style=flat-square
[license]: https://github.com/testing-library/angular-testing-library/blob/master/LICENSE
[license]: https://github.com/testing-library/angular-testing-library/blob/main/LICENSE
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[prs]: http://makeapullrequest.com
[donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
[coc]: https://github.com/testing-library/angular-testing-library/blob/master/CODE_OF_CONDUCT.md
[coc]: https://github.com/testing-library/angular-testing-library/blob/main/CODE_OF_CONDUCT.md
[github-watch-badge]: https://img.shields.io/github/watchers/testing-library/angular-testing-library.svg?style=social
[github-watch]: https://github.com/testing-library/angular-testing-library/watchers
[github-star-badge]: https://img.shields.io/github/stars/testing-library/angular-testing-library.svg?style=social
53 changes: 40 additions & 13 deletions angular.json
Original file line number Diff line number Diff line change
@@ -15,15 +15,25 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist/apps/example-app",
"index": "apps/example-app/src/index.html",
"main": "apps/example-app/src/main.ts",
"polyfills": "apps/example-app/src/polyfills.ts",
"tsConfig": "apps/example-app/tsconfig.app.json",
"assets": ["apps/example-app/src/favicon.ico", "apps/example-app/src/assets"],
"styles": ["apps/example-app/src/styles.css"],
"scripts": []
"assets": [
"apps/example-app/src/favicon.ico",
"apps/example-app/src/assets"
],
"styles": [
"apps/example-app/src/styles.css"
],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
@@ -43,13 +53,14 @@
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
},
"outputs": ["{options.outputPath}"]
"outputs": [
"{options.outputPath}"
]
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
@@ -71,7 +82,13 @@
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/example-app/src/**/*.ts", "apps/example-app/src/**/*.html"]
"lintFilePatterns": [
"apps/example-app/**/*.ts",
"apps/example-app/**/*.html",
"apps/example-app/src/**/*.html",
"apps/example-app/src/**/*.html",
"apps/example-app/src/**/*.html"
]
}
},
"test": {
@@ -80,7 +97,9 @@
"jestConfig": "apps/example-app/jest.config.js",
"setupFile": "apps/example-app/src/test-setup.ts"
},
"outputs": ["coverage/"]
"outputs": [
"coverage/"
]
}
}
},
@@ -107,7 +126,9 @@
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"projects/testing-library/src/**/*.ts",
"projects/testing-library/**/*.ts",
"projects/testing-library/**/*.html",
"projects/testing-library/src/**/*.html",
"projects/testing-library/src/**/*.html",
"projects/testing-library/src/**/*.html"
]
@@ -133,7 +154,9 @@
"jestConfig": "projects/testing-library/jest.config.js",
"setupFile": "projects/testing-library/test-setup.ts"
},
"outputs": ["coverage/projects/testing-library"]
"outputs": [
"coverage/projects/testing-library"
]
}
}
},
@@ -160,7 +183,9 @@
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"projects/jest-utils/src/**/*.ts",
"projects/jest-utils/**/*.ts",
"projects/jest-utils/**/*.html",
"projects/jest-utils/src/**/*.html",
"projects/jest-utils/src/**/*.html",
"projects/jest-utils/src/**/*.html"
]
@@ -183,9 +208,11 @@
"jestConfig": "projects/jest-utils/jest.config.js",
"setupFile": "projects/jest-utils/test-setup.ts"
},
"outputs": ["coverage/projects/jest-utils"]
"outputs": [
"coverage/projects/jest-utils"
]
}
}
}
}
}
}
5 changes: 2 additions & 3 deletions apps/example-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["../../.eslintrc.json"],
"extends": "../../.eslintrc.json",
"ignorePatterns": ["!**/*"],
"overrides": [
{
@@ -25,8 +25,7 @@
"style": "kebab-case"
}
]
},
"plugins": ["@angular-eslint/eslint-plugin", "@typescript-eslint"]
}
},
{
"files": ["*.html"],
2 changes: 1 addition & 1 deletion apps/example-app/src/app/examples/09-router.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router';
import { map } from 'rxjs/operators';

@Component({
selector: 'app-master',
selector: 'app-main',
template: `
<a [routerLink]="'./detail/one'">Load one</a> | <a [routerLink]="'./detail/two'">Load two</a> |
<a [routerLink]="'./detail/three'">Load three</a> |
2 changes: 1 addition & 1 deletion apps/example-app/src/app/issues/issue-106.spec.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import { render, screen, fireEvent, waitFor } from '@testing-library/angular';
template: `<button (click)="toggleShow()" data-testid="toggle">toggle</button>
<div *ngIf="show$ | async" data-testid="getme">Here I am</div>`,
})
export class TestSelectComponent {
class TestSelectComponent {
showSubj = new BehaviorSubject(false);
show$ = this.showSubj.asObservable();

2 changes: 1 addition & 1 deletion apps/example-app/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -12,4 +12,4 @@ export const environment = {
* import the following file, but please comment it out in production mode
* because it will have performance impact when throw error
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
2 changes: 1 addition & 1 deletion apps/example-app/src/polyfills.ts
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@
/** *************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.

/** *************************************************************************************************
* APPLICATION IMPORTS
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"nx.json": "*"
},
"affected": {
"defaultBase": "master"
"defaultBase": "main"
},
"npmScope": "testing-library",
"tasksRunnerOptions": {
Loading