Skip to content

Commit

Permalink
Merge pull request #81 from nbeach/new-angular-versions
Browse files Browse the repository at this point in the history
Updated to test support for angular 7, 8 and 9
  • Loading branch information
nbeach committed Feb 12, 2020
2 parents 5a0a5f4 + bb65a92 commit 4a2b31f
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ng-unit · [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nbeach/ng-unit/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/ng-unit.svg?style=flat)](https://www.npmjs.com/package/ng-unit) [![Build Status](https://travis-ci.org/nbeach/ng-unit.svg?branch=master)](https://travis-ci.org/nbeach/ng-unit) [![Build Status](https://saucelabs.com/buildstatus/ngunit)](https://saucelabs.com/open_sauce/user/ngunit) [![Coverage Status](https://coveralls.io/repos/github/nbeach/ng-unit/badge.svg?branch=master)](https://coveralls.io/github/nbeach/ng-unit?branch=master)


The boilerplate reducing test utility for Angular. Supports Angular version 2.4.10 and greater, and running tests in in Chrome, Firefox, Edge, IE11, and Node (via JSDOM).
The boilerplate reducing test utility for Angular. Supports Angular 6 and greater, and running tests in in Chrome, Firefox, Edge, IE11, and Node (via JSDOM).

## What is ng-unit?
ng-unit seeks to simplify unit testing of Angular components by providing automated mocking of child components,
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"test": "mocha --opts mocha.opts --watch",
"test:coverage": "nyc mocha --opts mocha.opts",
"test:browsers": "./test-browsers.sh",
"test:prior-versions": "./test-angular-version.sh ^6.1.9 && ./test-angular-version.sh ^5.2.9 && ./test-angular-version.sh ^4.4.7 && ./test-angular-version.sh ^2.4.10",
"test:prior-versions": "./test-angular-version.sh ^8.2.14 && ./test-angular-version.sh ^7.2.15 && ./test-angular-version.sh ^6.1.10",
"lint": "tslint --project .",
"ci": "yarn test:browsers && yarn lint && yarn test:prior-versions && yarn test:coverage && yarn build && nyc report --reporter=text-lcov | coveralls "
},
Expand All @@ -63,12 +63,12 @@
"all": true
},
"devDependencies": {
"@angular/common": "^7.0.1",
"@angular/compiler": "^7.0.1",
"@angular/core": "^7.0.1",
"@angular/forms": "^7.0.1",
"@angular/platform-browser": "^7.0.1",
"@angular/platform-browser-dynamic": "^7.0.1",
"@angular/common": "^9.0.0",
"@angular/compiler": "^9.0.0",
"@angular/core": "^9.0.0",
"@angular/forms": "^9.0.0",
"@angular/platform-browser": "^9.0.0",
"@angular/platform-browser-dynamic": "^9.0.0",
"@types/chai": "^4.0.4",
"@types/chai-dom": "0.0.7",
"@types/lodash": "^4.14.74",
Expand Down Expand Up @@ -96,10 +96,11 @@
"sinon": "^4.0.1",
"sinon-chai": "^3.0.0",
"ts-loader": "^5.3.3",
"ts-node": "^8.0.2",
"ts-node": "^8.6.2",
"tslib": "^1.10.0",
"tslint": "^5.9.1",
"tslint-no-unused-expression-chai": "^0.1.3",
"typescript": "~3.3.3333",
"typescript": "~3.7.3",
"webpack": "^4.11.1",
"zone.js": "^0.8.17"
},
Expand Down
2 changes: 1 addition & 1 deletion src/test-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const setInput = (inputName: string, value: any): void => {
throwIfNotIn(inputName, _initializedInputs, "In order to set an input after begin() is called you must provide an initial value with .setInput() at test setup time.")
testFixture.componentInstance[inputName] = value
}
export const onOutput = (outputName: string, action: (event: any) => void): void => subject()[outputName].subscribe(action)
export const onOutput = (outputName: string, action: (event: any) => void): void => subject<any>()[outputName].subscribe(action)
export const detectChanges = (): void => fixture().detectChanges()
export const teardown = (): void => {
TestBed.resetTestingModule()
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"types": ["node", "mocha", "chai-dom", "sinon-chai", "webpack-env"],
"declaration" : true
}
}
}
99 changes: 53 additions & 46 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,35 @@
# yarn lockfile v1


"@angular/common@^7.0.1":
version "7.2.8"
resolved "https://registry.yarnpkg.com/@angular/common/-/common-7.2.8.tgz#660c816b6f08cd2919a6efb7465397e4ff14d265"
dependencies:
tslib "^1.9.0"

"@angular/compiler@^7.0.1":
version "7.2.8"
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-7.2.8.tgz#9d9c1515e99914399e6915c1c90484b1d255560b"
dependencies:
tslib "^1.9.0"

"@angular/core@^7.0.1":
version "7.2.8"
resolved "https://registry.yarnpkg.com/@angular/core/-/core-7.2.8.tgz#6586d9b6c6321c80119b3f3e2bd0edbb32d0b649"
dependencies:
tslib "^1.9.0"

"@angular/forms@^7.0.1":
version "7.2.8"
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-7.2.8.tgz#adf194088495822d55dcf3e5bf69196dcf19465d"
dependencies:
tslib "^1.9.0"

"@angular/platform-browser-dynamic@^7.0.1":
version "7.2.8"
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-7.2.8.tgz#e82768900cedfa75bf453263f931a9f90f7aaab2"
dependencies:
tslib "^1.9.0"

"@angular/platform-browser@^7.0.1":
version "7.2.8"
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-7.2.8.tgz#11096727b99bf3d7fd82a00a3a468b933c9713bd"
dependencies:
tslib "^1.9.0"
"@angular/common@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@angular/common/-/common-9.0.0.tgz#0e3b2452d42f87d1825a448a31ad72c593ee0785"
integrity sha512-ZMmEClGtUNJwV5CBlqcSHPIsNyz6WU/GvKWFzJ5VZc68oeg1e7lqfNMNIC47TjyolNJ7VSpNlyrKjzfdBlmqVw==

"@angular/compiler@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-9.0.0.tgz#87e0bef4c369b6cadae07e3a4295778fc93799d5"
integrity sha512-ctjwuntPfZZT2mNj2NDIVu51t9cvbhl/16epc5xEwyzyDt76pX9UgwvY+MbXrf/C/FWwdtmNtfP698BKI+9leQ==

"@angular/core@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@angular/core/-/core-9.0.0.tgz#227dc53e1ac81824f998c6e76000b7efc522641e"
integrity sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w==

"@angular/forms@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-9.0.0.tgz#2017e4ddee101fa57dc5dc9ba1139b1f02499422"
integrity sha512-SIYJc0Rgaihow1t+iiwSFGEvvRgssgUuxwIYbMfCp1Sx513K+JX9nVFXqU+dcGj/eF1u5wwYwbvlVyuMQLzmXg==

"@angular/platform-browser-dynamic@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-9.0.0.tgz#1b87355c20d0b2a046c1914085701a3d5ced52da"
integrity sha512-F1kbEpmDottTemRPEOAz2Te5ABVJ7wypfzBllxqXbdxPHvYLfL8db2dXyiGqABQ3ZFHPLNilrkUTy0sbuuU4OA==

"@angular/platform-browser@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-9.0.0.tgz#b9454f29d8edaf024668baa9e07083eef73deac2"
integrity sha512-2PR/o57HjZvKEnAF8ODeqxmeC90oth9dLTMrJNoI5MET0IeErKeI/9Sl5cLQuXC+lSVN5rOMCvDb74VWSno5yw==

"@babel/code-frame@^7.0.0":
version "7.0.0"
Expand Down Expand Up @@ -1280,6 +1274,11 @@ diff@3.5.0, diff@^3.1.0, diff@^3.2.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"

diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==

diffie-hellman@^5.0.0:
version "5.0.3"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875"
Expand Down Expand Up @@ -4206,15 +4205,21 @@ ts-loader@^5.3.3:
micromatch "^3.1.4"
semver "^5.0.1"

ts-node@^8.0.2:
version "8.0.2"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.0.2.tgz#9ecdf8d782a0ca4c80d1d641cbb236af4ac1b756"
ts-node@^8.6.2:
version "8.6.2"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.6.2.tgz#7419a01391a818fbafa6f826a33c1a13e9464e35"
integrity sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==
dependencies:
arg "^4.1.0"
diff "^3.1.0"
diff "^4.0.1"
make-error "^1.1.1"
source-map-support "^0.5.6"
yn "^3.0.0"
yn "3.1.1"

tslib@^1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==

tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:
version "1.9.3"
Expand Down Expand Up @@ -4291,9 +4296,10 @@ typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"

typescript@~3.3.3333:
version "3.3.3333"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3333.tgz#171b2c5af66c59e9431199117a3bcadc66fdcfd6"
typescript@~3.7.3:
version "3.7.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==

uglify-js@^3.1.4:
version "3.4.9"
Expand Down Expand Up @@ -4666,9 +4672,10 @@ yeast@0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"

yn@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.0.0.tgz#0073c6b56e92aed652fbdfd62431f2d6b9a7a091"
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==

zone.js@^0.8.17:
version "0.8.29"
Expand Down

0 comments on commit 4a2b31f

Please sign in to comment.