diff --git a/angular.json b/angular.json index dfd6bcf1..46abc72c 100644 --- a/angular.json +++ b/angular.json @@ -3,7 +3,6 @@ "projects": { "example-app": "apps/example-app", "example-app-karma": "apps/example-app-karma", - "jest-utils": "projects/jest-utils", "testing-library": "projects/testing-library" } } diff --git a/package.json b/package.json index 818f0dd6..66fb3d80 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main", "start": "nx serve", "prebuild": "rimraf dist", - "build": "nx run-many --target=build --projects=testing-library,jest-utils", + "build": "nx run-many --target=build --projects=testing-library", "build:schematics": "tsc -p ./projects/testing-library/tsconfig.schematics.json", "test": "nx run-many --target=test --all", "lint": "nx workspace-lint && nx lint", diff --git a/projects/jest-utils/.eslintrc.json b/projects/jest-utils/.eslintrc.json deleted file mode 100644 index 785bfebc..00000000 --- a/projects/jest-utils/.eslintrc.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "extends": "../../.eslintrc.json", - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts"], - "extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"], - "parserOptions": { - "project": ["projects/jest-utils/tsconfig.*?.json"] - }, - "rules": { - "@angular-eslint/directive-selector": [ - "error", - { - "type": "attribute", - "prefix": "atl", - "style": "camelCase" - } - ], - "@angular-eslint/component-selector": [ - "error", - { - "type": "element", - "prefix": "atl", - "style": "kebab-case" - } - ] - } - }, - { - "files": ["*.spec.ts"], - "env": { - "jest": true - }, - "extends": ["plugin:jest/recommended", "plugin:jest/style", "plugin:jest-dom/recommended"], - "rules": { - "jest/consistent-test-it": ["error"], - "jest/expect-expect": "off" - } - }, - { - "files": ["*.html"], - "extends": ["plugin:@nrwl/nx/angular-template"], - "rules": {} - } - ] -} diff --git a/projects/jest-utils/jest.config.js b/projects/jest-utils/jest.config.js deleted file mode 100644 index 0d80b628..00000000 --- a/projects/jest-utils/jest.config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - name: 'Jest utils', - displayName: { - name: 'JEST UTILS', - color: 'magenta', - }, - preset: '../../jest.preset.js', - setupFilesAfterEnv: ['/test-setup.ts'], -}; diff --git a/projects/jest-utils/ng-package.json b/projects/jest-utils/ng-package.json deleted file mode 100644 index 210c7bc0..00000000 --- a/projects/jest-utils/ng-package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", - "dest": "../../dist/@testing-library/angular/jest-utils", - "deleteDestPath": false, - "lib": { - "entryFile": "index.ts" - } -} diff --git a/projects/jest-utils/package.json b/projects/jest-utils/package.json deleted file mode 100644 index 4462dc31..00000000 --- a/projects/jest-utils/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@testing-library/angular/jest-utils", - "version": "0.0.0-semantically-released", - "description": "Test your Angular components with the dom-testing-library", - "repository": { - "type": "git", - "url": "git+https://github.com/testing-library/angular-testing-library.git" - }, - "keywords": [ - "angular", - "ngx", - "ng", - "typescript", - "angular2", - "test", - "dom-testing-library" - ], - "author": "Tim Deschryver", - "license": "MIT", - "bugs": { - "url": "https://github.com/testing-library/angular-testing-library/issues" - }, - "homepage": "https://github.com/testing-library/angular-testing-library#readme", - "peerDependencies": { - "jest": ">=27.0.0" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "tslib": "^2.0.0" - } -} diff --git a/projects/jest-utils/project.json b/projects/jest-utils/project.json deleted file mode 100644 index 8c4976f6..00000000 --- a/projects/jest-utils/project.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "projectType": "library", - "root": "projects/jest-utils", - "sourceRoot": "projects/jest-utils/src", - "prefix": "lib", - "targets": { - "build-package": { - "executor": "@nrwl/angular:package", - "outputs": ["dist/@testing-library/angular/jest-utils"], - "options": { - "project": "projects/jest-utils/ng-package.json" - }, - "configurations": { - "production": { - "tsConfig": "projects/jest-utils/tsconfig.lib.prod.json" - }, - "development": { - "tsConfig": "projects/jest-utils/tsconfig.lib.json" - } - }, - "defaultConfiguration": "production" - }, - "lint": { - "executor": "@nrwl/linter:eslint", - "options": { - "lintFilePatterns": [ - "projects/jest-utils/**/*.ts", - "projects/jest-utils/**/*.html", - "projects/jest-utils/src/**/*.html" - ] - }, - "outputs": ["{options.outputFile}"] - }, - "build": { - "executor": "@nrwl/workspace:run-commands", - "options": { - "parallel": false, - "commands": [ - { - "command": "nx run jest-utils:build-package" - } - ] - } - }, - "test": { - "executor": "@nrwl/jest:jest", - "options": { - "jestConfig": "projects/jest-utils/jest.config.js" - }, - "outputs": ["coverage/projects/jest-utils"] - } - }, - "tags": [] -} diff --git a/projects/jest-utils/test-setup.ts b/projects/jest-utils/test-setup.ts deleted file mode 100644 index 0da94a0a..00000000 --- a/projects/jest-utils/test-setup.ts +++ /dev/null @@ -1,2 +0,0 @@ -import 'jest-preset-angular/setup-jest'; -import '@testing-library/jest-dom'; diff --git a/projects/jest-utils/tsconfig.json b/projects/jest-utils/tsconfig.json deleted file mode 100644 index 24663f6f..00000000 --- a/projects/jest-utils/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.lib.prod.json" - }, - { - "path": "./tsconfig.spec.json" - } - ], - "compilerOptions": {}, - "angularCompilerOptions": { - "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true, - "flatModuleId": "AUTOGENERATED", - "flatModuleOutFile": "AUTOGENERATED" - } -} diff --git a/projects/jest-utils/tsconfig.lib.json b/projects/jest-utils/tsconfig.lib.json deleted file mode 100644 index 0566ff84..00000000 --- a/projects/jest-utils/tsconfig.lib.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "declaration": true, - "declarationMap": true, - "inlineSources": true, - "types": ["jest"] - }, - "exclude": ["src/test.ts", "**/*.spec.ts", "**/*.test.ts"], - "include": ["**/*.ts"] -} diff --git a/projects/jest-utils/tsconfig.lib.prod.json b/projects/jest-utils/tsconfig.lib.prod.json deleted file mode 100644 index 2a2faa88..00000000 --- a/projects/jest-utils/tsconfig.lib.prod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.lib.json", - "compilerOptions": { - "declarationMap": false - }, - "angularCompilerOptions": { - "compilationMode": "partial" - } -} diff --git a/projects/jest-utils/tsconfig.spec.json b/projects/jest-utils/tsconfig.spec.json deleted file mode 100644 index 73461f35..00000000 --- a/projects/jest-utils/tsconfig.spec.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "types": ["node", "jest", "@testing-library/jest-dom"] - }, - "files": ["test-setup.ts"], - "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] -} diff --git a/projects/jest-utils/index.ts b/projects/testing-library/jest-utils/index.ts similarity index 100% rename from projects/jest-utils/index.ts rename to projects/testing-library/jest-utils/index.ts diff --git a/projects/testing-library/jest-utils/ng-package.json b/projects/testing-library/jest-utils/ng-package.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/projects/testing-library/jest-utils/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/projects/jest-utils/src/lib/create-mock.ts b/projects/testing-library/jest-utils/src/lib/create-mock.ts similarity index 100% rename from projects/jest-utils/src/lib/create-mock.ts rename to projects/testing-library/jest-utils/src/lib/create-mock.ts diff --git a/projects/jest-utils/src/lib/index.ts b/projects/testing-library/jest-utils/src/lib/index.ts similarity index 100% rename from projects/jest-utils/src/lib/index.ts rename to projects/testing-library/jest-utils/src/lib/index.ts diff --git a/projects/jest-utils/src/public_api.ts b/projects/testing-library/jest-utils/src/public_api.ts similarity index 100% rename from projects/jest-utils/src/public_api.ts rename to projects/testing-library/jest-utils/src/public_api.ts diff --git a/projects/jest-utils/tests/create-mock.spec.ts b/projects/testing-library/jest-utils/tests/create-mock.spec.ts similarity index 100% rename from projects/jest-utils/tests/create-mock.spec.ts rename to projects/testing-library/jest-utils/tests/create-mock.spec.ts diff --git a/tsconfig.base.json b/tsconfig.base.json index 1e0de6e1..ede79fb8 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -23,7 +23,7 @@ "noUnusedParameters": true, "paths": { "@testing-library/angular": ["projects/testing-library"], - "@testing-library/angular/jest-utils": ["projects/jest-utils"] + "@testing-library/angular/jest-utils": ["projects/testing-library/jest-utils"] } }, "exclude": ["node_modules", "tmp"]