Skip to content

Commit

Permalink
Feature/update update Anuglar to version 16 & add jest for unit-tests (
Browse files Browse the repository at this point in the history
…#29)

* feature: update angular to 15

* feature: update angular to 16

* feature: update angular to 16 & add jest for unit tests

* feature: fix lint not bother with demo app tests

---------

Co-authored-by: Manuel Schmidt <[email protected]>
  • Loading branch information
Kr0san89 and Manuel Schmidt authored Aug 26, 2023
1 parent d7eda05 commit bf3c40b
Show file tree
Hide file tree
Showing 21 changed files with 16,801 additions and 14,281 deletions.
38 changes: 20 additions & 18 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,45 @@
"root": true,
"overrides": [
{
"files": ["*.ts"],
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.app.json",
"tsconfig.spec.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
// This is required if you use inline templates in Components
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
/**
* Any TypeScript source code (NOT TEMPLATE) related rules you wish to use/reconfigure over and above the
* recommended set provided by the @angular-eslint project would go here.
*/
"@angular-eslint/directive-selector": [
"error",
{ "type": "attribute", "prefix": "app", "style": "camelCase" }
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{ "type": "element", "prefix": "app", "style": "kebab-case" }
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {
/**
* Any template/HTML related rules you wish to use/reconfigure over and above the
* recommended set provided by the @angular-eslint project would go here.
*/
}
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Lint
run: npm run lint

#- name: Test
# run: npm run test
- name: Test
run: npm run test

- name: Build
run: npm run build:lib
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ npm install --save ng-click-outside2
```

## Compatibility
| Angular | Version | NPM |
|---------|---------|---|
| 13 | 10.x.x | `ng-click-outside2@^10.0.0` |
| Angular | Version | NPM |
|----------|---------|-----------------------------|
| 13 | 10.x.x | `ng-click-outside2@^10.0.0` |
| 14,15,16 | 11.x.x | `ng-click-outside2@^11.0.0` |
| 16 | 12.x.x | `ng-click-outside2@^12.0.0` |

If you still use Angular <= 12 please use the original package. https://www.npmjs.com/package/ng-click-outside

Expand Down
35 changes: 13 additions & 22 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-devkit/build-angular:jest",
"options": {
"main": "projects/ng-click-outside2/src/test.ts",
"tsConfig": "projects/ng-click-outside2/tsconfig.spec.json",
"karmaConfig": "projects/ng-click-outside2/karma.conf.js"
"polyfills": ["zone.js", "zone.js/testing"]
}
},
"lint": {
Expand Down Expand Up @@ -126,24 +125,6 @@
"browserTarget": "demo:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/demo/src/test.ts",
"polyfills": "projects/demo/src/polyfills.ts",
"tsConfig": "projects/demo/tsconfig.spec.json",
"karmaConfig": "projects/demo/karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"projects/demo/src/favicon.ico",
"projects/demo/src/assets"
],
"styles": [
"projects/demo/src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
Expand Down Expand Up @@ -174,7 +155,9 @@
"development": {
"optimization": false,
"sourceMap": true,
"extractLicenses": false
"extractLicenses": false,
"vendorChunk": true,
"buildOptimizer": false
}
},
"defaultConfiguration": "production"
Expand Down Expand Up @@ -217,5 +200,13 @@
},
"cli": {
"analytics": false
},
"schematics": {
"@angular-eslint/schematics:application": {
"setParserOptionsProject": true
},
"@angular-eslint/schematics:library": {
"setParserOptionsProject": true
}
}
}
4 changes: 4 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

module.exports = {
preset: 'jest-preset-angular',
};
Loading

0 comments on commit bf3c40b

Please sign in to comment.