Skip to content

Commit 7f1dce6

Browse files
feat: initial release of scoped package (#20)
Reference: testing-library/dom-testing-library#260 BREAKING CHANGE: You must update all imports from '@angular-extensions/testing-library' to '@testing-library/angular'
1 parent 474253f commit 7f1dce6

16 files changed

+58
-60
lines changed

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<h1>@angular-extensions/testing-library</h1>
2+
<h1>@testing-library/angular</h1>
33

44
<a href="https://www.emojione.com/emoji/1f994">
55
<img
@@ -80,9 +80,9 @@ your team down.
8080

8181
## This solution
8282

83-
The `@angular-extensions/testing-library` is a very lightweight solution for
83+
The `@testing-library/angular` is a very lightweight solution for
8484
testing Angular components. It provides light utility functions on top of `Angular`
85-
and `dom-testing-library`, in a way that encourages better testing practices. Its
85+
and `@testing-library/dom`, in a way that encourages better testing practices. Its
8686
primary guiding principle is:
8787

8888
> [The more your tests resemble the way your software is used, the more
@@ -117,7 +117,7 @@ export class CounterComponent {
117117
counter.component.spec.ts
118118

119119
```javascript
120-
import { render } from '@angular-extensions/testing-library';
120+
import { render } from '@testing-library/angular';
121121
import CounterComponent from './counter.component.ts';
122122

123123
describe('Counter', () => {
@@ -143,7 +143,7 @@ This module is distributed via [npm][npm] which is bundled with [node][node] and
143143
should be installed as one of your project's `devDependencies`:
144144

145145
```bash
146-
npm install @angular-extensions/testing-library --save-dev
146+
npm install @testing-library/angular --save-dev
147147
```
148148

149149
You may also be interested in installing `jest-dom` so you can use
@@ -232,13 +232,13 @@ Links:
232232
[build]: https://circleci.com/gh/testing-library/angular-testing-library/tree/master
233233
[coverage]: https://codecov.io/github/testing-library/angular-testing-library
234234
[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/angular-testing-library.svg?style=flat-square
235-
[version-badge]: https://img.shields.io/npm/v/@angular-extensions/testing-library.svg?style=flat-square
236-
[package]: https://www.npmjs.com/package/@angular-extensions/testing-library
237-
[downloads-badge]: https://img.shields.io/npm/dm/@angular-extensions/testing-library.svg?style=flat-square
238-
[npmtrends]: http://www.npmtrends.com/@angular-extensions/testing-library
235+
[version-badge]: https://img.shields.io/npm/v/@testing-library/angular.svg?style=flat-square
236+
[package]: https://www.npmjs.com/package/@testing-library/angular
237+
[downloads-badge]: https://img.shields.io/npm/dm/@testing-library/angular.svg?style=flat-square
238+
[npmtrends]: http://www.npmtrends.com/@testing-library/angular
239239
[spectrum-badge]: https://withspectrum.github.io/badge/badge.svg
240240
[spectrum]: https://spectrum.chat/testing-library
241-
[license-badge]: https://img.shields.io/npm/l/@angular-extensions/testing-library.svg?style=flat-square
241+
[license-badge]: https://img.shields.io/npm/l/@testing-library/angular.svg?style=flat-square
242242
[license]: https://github.com/testing-library/angular-testing-library/blob/master/LICENSE
243243
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
244244
[prs]: http://makeapullrequest.com
@@ -249,7 +249,7 @@ Links:
249249
[github-watch]: https://github.com/testing-library/angular-testing-library/watchers
250250
[github-star-badge]: https://img.shields.io/github/stars/testing-library/angular-testing-library.svg?style=social
251251
[github-star]: https://github.com/testing-library/angular-testing-library/stargazers
252-
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20🦔%20@angular-extensions/testing-library%20by%20%40tim_deschryver%20https%3A%2F%2Fgithub.com%2F@angular-extensions/testing-library
252+
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20🦔%20@testing-library/angular%20by%20%40tim_deschryver%20https%3A%2F%2Fgithub.com%2F@testing-library/angular
253253
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/testing-library/angular-testing-library.svg?style=social
254254
[emojis]: https://github.com/all-contributors/all-contributors#emoji-key
255255
[all-contributors]: https://github.com/all-contributors/all-contributors

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@angular-extensions/testing-library-app",
2+
"name": "@testing-library/angular-app",
33
"version": "0.0.0-semantically-released",
44
"scripts": {
55
"ng": "ng",
@@ -8,8 +8,8 @@
88
"build": "npm run build:library && npm run build:library:jest-utils && npm run build:migrations && npm run build:readme",
99
"build:library": "ng build --prod testing-library",
1010
"build:library:jest-utils": "ng build --prod jest-utils",
11-
"build:migrations": "tsc -p ./projects/testing-library/migrations/tsconfig.migrations.json && cp ./projects/testing-library/migrations/migration.json ./dist/@angular-extensions/testing-library/migrations",
12-
"build:readme": "cp ./README.md ./dist/@angular-extensions/testing-library",
11+
"build:migrations": "tsc -p ./projects/testing-library/migrations/tsconfig.migrations.json && cp ./projects/testing-library/migrations/migration.json ./dist/@testing-library/angular/migrations",
12+
"build:readme": "cp ./README.md ./dist/@testing-library/angular",
1313
"test": "jest --config ./projects/jest.lib.config.js",
1414
"test:app": "jest --config ./src/jest.app.config.js",
1515
"precommit": "lint-staged",
@@ -23,7 +23,7 @@
2323
]
2424
},
2525
"release": {
26-
"pkgRoot": "dist/@angular-extensions/testing-library"
26+
"pkgRoot": "dist/@testing-library/angular"
2727
},
2828
"dependencies": {
2929
"@angular/animations": "^8.0.0",
@@ -35,8 +35,8 @@
3535
"@angular/platform-browser-dynamic": "^8.0.0",
3636
"@angular/router": "^8.0.0",
3737
"@phenomnomnominal/tsquery": "^3.0.0",
38+
"@testing-library/dom": "^5.0.1",
3839
"core-js": "^3.1.3",
39-
"dom-testing-library": "^4.1.1",
4040
"rxjs": "^6.5.2",
4141
"tslint": "^5.16.0",
4242
"zone.js": "~0.9.1"
@@ -47,8 +47,8 @@
4747
"@angular/cli": "~8.0.0",
4848
"@angular/compiler-cli": "^8.0.0",
4949
"@angular/language-service": "^8.0.0",
50-
"@types/node": "~12.0.3",
5150
"@types/jest": "~24.0.11",
51+
"@types/node": "~12.0.3",
5252
"codelyzer": "^5.0.1",
5353
"husky": "^2.3.0",
5454
"jest": "^24.1.0",

projects/jest-utils/ng-package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3-
"dest": "../../@angular-extensions/testing-library/jest-utils",
3+
"dest": "../../@testing-library/angular/jest-utils",
44
"deleteDestPath": false,
55
"lib": {
66
"entryFile": "src/public_api.ts"

projects/jest-utils/ng-package.prod.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3-
"dest": "../../dist/@angular-extensions/testing-library/jest-utils",
3+
"dest": "../../dist/@testing-library/angular/jest-utils",
44
"deleteDestPath": false,
55
"lib": {
66
"entryFile": "src/public_api.ts"

projects/jest-utils/package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "@angular-extensions/testing-library/jest-utils",
2+
"name": "@testing-library/angular/jest-utils",
33
"version": "0.0.0-semantically-released",
44
"description": "Test your Angular components with the dom-testing-library",
55
"repository": {
66
"type": "git",
7-
"url": "git+https://github.com/angular-extensions/testing-library.git"
7+
"url": "git+https://github.com/testing-library/angular-testing-library.git"
88
},
99
"keywords": [
1010
"angular",
@@ -13,15 +13,14 @@
1313
"typescript",
1414
"angular2",
1515
"test",
16-
"dom-testing-library",
17-
"angular-extensions"
16+
"dom-testing-library"
1817
],
1918
"author": "Tim Deschryver",
2019
"license": "MIT",
2120
"bugs": {
22-
"url": "https://github.com/angular-extensions/testing-library/issues"
21+
"url": "https://github.com/testing-library/angular-testing-library/issues"
2322
},
24-
"homepage": "https://github.com/angular-extensions/testing-library#readme",
23+
"homepage": "https://github.com/testing-library/angular-testing-library#readme",
2524
"peerDependencies": {
2625
"jest": ">=23.4.0"
2726
},

projects/testing-library/migrations/tsconfig.migrations.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"target": "es5",
55
"sourceMap": true,
66
"rootDir": "./",
7-
"outDir": "../../../dist/@angular-extensions/testing-library/migrations",
7+
"outDir": "../../../dist/@testing-library/angular/migrations",
88
"noLib": false,
99
"baseUrl": "./",
1010
"experimentalDecorators": true,
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3-
"dest": "../../dist/@angular-extensions/testing-library",
3+
"dest": "../../dist/@testing-library/angular",
44
"deleteDestPath": false,
55
"lib": {
66
"entryFile": "src/public_api.ts"
77
},
8-
"whitelistedNonPeerDependencies": ["dom-testing-library", "@phenomnomnominal/tsquery", "tslint"]
8+
"whitelistedNonPeerDependencies": ["@testing-library/dom", "@phenomnomnominal/tsquery", "tslint"]
99
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3-
"dest": "../../dist/@angular-extensions/testing-library",
3+
"dest": "../../dist/@testing-library/angular",
44
"deleteDestPath": false,
55
"lib": {
66
"entryFile": "src/public_api.ts"
77
},
8-
"whitelistedNonPeerDependencies": ["dom-testing-library", "@phenomnomnominal/tsquery", "tslint"]
8+
"whitelistedNonPeerDependencies": ["@testing-library/dom", "@phenomnomnominal/tsquery", "tslint"]
99
}

projects/testing-library/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@angular-extensions/testing-library",
2+
"name": "@testing-library/angular",
33
"version": "0.0.0-semantically-released",
44
"description": "Test your Angular components with the dom-testing-library",
55
"repository": {
@@ -13,8 +13,7 @@
1313
"typescript",
1414
"angular2",
1515
"test",
16-
"dom-testing-library",
17-
"angular-extensions"
16+
"dom-testing-library"
1817
],
1918
"author": "Tim Deschryver",
2019
"license": "MIT",
@@ -27,7 +26,7 @@
2726
"@angular/core": "^8.0.0"
2827
},
2928
"dependencies": {
30-
"dom-testing-library": "^4.1.0",
29+
"@testing-library/dom": "^5.1.0",
3130
"@phenomnomnominal/tsquery": "^3.0.0",
3231
"tslint": "^5.16.0"
3332
},

projects/testing-library/src/lib/models.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Type } from '@angular/core';
22
import { ComponentFixture } from '@angular/core/testing';
3-
import { FireObject, Queries, queries, BoundFunction } from 'dom-testing-library';
3+
import { FireObject, Queries, queries, BoundFunction } from '@testing-library/dom';
44

55
export type RenderResultQueries<Q extends Queries = typeof queries> = { [P in keyof Q]: BoundFunction<Q[P]> };
66

projects/testing-library/src/lib/testing-library.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, OnInit, ElementRef, Type, DebugElement } from '@angular/core';
22
import { By } from '@angular/platform-browser';
33
import { TestBed, ComponentFixture } from '@angular/core/testing';
4-
import { getQueriesForElement, prettyDOM, fireEvent, FireObject, FireFunction } from 'dom-testing-library';
4+
import { getQueriesForElement, prettyDOM, fireEvent, FireObject, FireFunction } from '@testing-library/dom';
55
import { RenderResult, RenderOptions } from './models';
66

77
@Component({ selector: 'wrapper-component', template: '' })

projects/testing-library/src/public_api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
export * from './lib/models';
66
export * from './lib/testing-library';
7-
export * from 'dom-testing-library';
7+
export * from '@testing-library/dom';

projects/testing-library/tests/migration/4_0_0.spec.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('Migration to version 4.0.0', () => {
99
{
1010
description: 'template syntax',
1111
input: virtualFs.stringToFileBuffer(`
12-
import { createComponent } from '@angular-extensions/testing-library';
12+
import { createComponent } from '@testing-library/angular';
1313
import { HomeComponent } from './home.component';
1414
1515
async function setup() {
@@ -18,7 +18,7 @@ describe('Migration to version 4.0.0', () => {
1818
});
1919
}`),
2020
expected: `
21-
import { render } from '@angular-extensions/testing-library';
21+
import { render } from '@testing-library/angular';
2222
import { HomeComponent } from './home.component';
2323
2424
async function setup() {
@@ -30,7 +30,7 @@ describe('Migration to version 4.0.0', () => {
3030
{
3131
description: 'component syntax',
3232
input: virtualFs.stringToFileBuffer(`
33-
import { createComponent } from '@angular-extensions/testing-library';
33+
import { createComponent } from '@testing-library/angular';
3434
import { HomeComponent } from './home.component';
3535
3636
async function setup() {
@@ -44,7 +44,7 @@ describe('Migration to version 4.0.0', () => {
4444
);
4545
}`),
4646
expected: `
47-
import { render } from '@angular-extensions/testing-library';
47+
import { render } from '@testing-library/angular';
4848
import { HomeComponent } from './home.component';
4949
5050
async function setup() {
@@ -59,7 +59,7 @@ describe('Migration to version 4.0.0', () => {
5959
{
6060
description: 'component syntax with properties',
6161
input: virtualFs.stringToFileBuffer(`
62-
import { createComponent } from '@angular-extensions/testing-library';
62+
import { createComponent } from '@testing-library/angular';
6363
import { HomeComponent } from './home.component';
6464
6565
async function setup() {
@@ -77,7 +77,7 @@ describe('Migration to version 4.0.0', () => {
7777
);
7878
}`),
7979
expected: `
80-
import { render } from '@angular-extensions/testing-library';
80+
import { render } from '@testing-library/angular';
8181
import { HomeComponent } from './home.component';
8282
8383
async function setup() {

src/app/app.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AppComponent } from './app.component';
2-
import { render } from '@angular-extensions/testing-library';
3-
import { configureJestSetup } from '@angular-extensions/testing-library/jest-utils';
2+
import { render } from '@testing-library/angular';
3+
import { configureJestSetup } from '@testing-library/angular/jest-utils';
44

55
configureJestSetup();
66

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"typeRoots": ["node_modules/@types"],
1515
"lib": ["es2017", "dom"],
1616
"paths": {
17-
"@angular-extensions/testing-library": ["dist/@angular-extensions/testing-library"],
18-
"@angular-extensions/testing-library/*": ["dist/@angular-extensions/testing-library/*"]
17+
"@testing-library/angular": ["dist/@testing-library/angular"],
18+
"@testing-library/angular/*": ["dist/@testing-library/angular/*"]
1919
}
2020
}
2121
}

yarn.lock

+13-13
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
dependencies:
310310
"@babel/helper-plugin-utils" "^7.0.0"
311311

312-
"@babel/runtime@^7.0.0", "@babel/runtime@^7.4.3":
312+
"@babel/runtime@^7.0.0", "@babel/runtime@^7.4.5":
313313
version "7.4.5"
314314
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12"
315315
integrity sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==
@@ -707,6 +707,16 @@
707707
dependencies:
708708
defer-to-connect "^1.0.1"
709709

710+
"@testing-library/dom@^5.0.1":
711+
version "5.0.1"
712+
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-5.0.1.tgz#1673a56f27fd9748576495958a27b0e5a408db5d"
713+
integrity sha512-HmyN4b/PmSaSB1ku0tWjgnTtyrwNBXEpp44wgfNaDhyj6IJTCWp1GAf4AANoLGItgMsYjepwWOdMyuJ/8iyStQ==
714+
dependencies:
715+
"@babel/runtime" "^7.4.5"
716+
"@sheerun/mutationobserver-shim" "^0.3.2"
717+
pretty-format "^24.8.0"
718+
wait-for-expect "^1.2.0"
719+
710720
"@types/babel__core@^7.1.0":
711721
version "7.1.2"
712722
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f"
@@ -3066,16 +3076,6 @@ dns-txt@^2.0.2:
30663076
dependencies:
30673077
buffer-indexof "^1.0.0"
30683078

3069-
dom-testing-library@^4.1.1:
3070-
version "4.1.1"
3071-
resolved "https://registry.yarnpkg.com/dom-testing-library/-/dom-testing-library-4.1.1.tgz#615af61bee06db51bd8ecea60c113eba7cb49dda"
3072-
integrity sha512-PUsG7aY5BJxzulDrOtkksqudRRypcVQF6d4RGAyj9xNwallOFqrNLOyg2QW2mCpFaNVPELX8hBX/wbHQtOto/A==
3073-
dependencies:
3074-
"@babel/runtime" "^7.4.3"
3075-
"@sheerun/mutationobserver-shim" "^0.3.2"
3076-
pretty-format "^24.7.0"
3077-
wait-for-expect "^1.1.1"
3078-
30793079
domain-browser@^1.1.1:
30803080
version "1.2.0"
30813081
resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda"
@@ -7757,7 +7757,7 @@ prettier@^1.17.1:
77577757
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.1.tgz#ed64b4e93e370cb8a25b9ef7fef3e4fd1c0995db"
77587758
integrity sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==
77597759

7760-
pretty-format@^24.0.0, pretty-format@^24.7.0, pretty-format@^24.8.0:
7760+
pretty-format@^24.0.0, pretty-format@^24.8.0:
77617761
version "24.8.0"
77627762
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2"
77637763
integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==
@@ -10166,7 +10166,7 @@ w3c-xmlserializer@^1.0.1:
1016610166
webidl-conversions "^4.0.2"
1016710167
xml-name-validator "^3.0.0"
1016810168

10169-
wait-for-expect@^1.1.1:
10169+
wait-for-expect@^1.2.0:
1017010170
version "1.2.0"
1017110171
resolved "https://registry.yarnpkg.com/wait-for-expect/-/wait-for-expect-1.2.0.tgz#fdab6a26e87d2039101db88bff3d8158e5c3e13f"
1017210172
integrity sha512-EJhKpA+5UHixduMBEGhTFuLuVgQBKWxkFbefOdj2bbk2/OpA5Opsc4aUTGmF+qJ+v3kTGxDRNYwKaT4j6g5n8Q==

0 commit comments

Comments
 (0)