Skip to content

Commit

Permalink
feat: support angular 6 and test 5 & 6 in travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ike18t committed May 14, 2018
1 parent 810c638 commit 5bc9331
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ before_script:
- "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
before_install:
- npm cache clean --force
script: npm run lint && npm test
script: npm run test:angular-versions
matrix:
notifications:
email:
Expand Down
24 changes: 24 additions & 0 deletions build-with-supported-angluars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
set -e
VERSIONS="5.0 5.1 5 6"
PACKAGES="common compiler core forms platform-browser platform-browser-dynamic"

for version in $VERSIONS
do
echo Building with Angular $version...
OLD="rxjs zone.js"
NEW=""
for package in $PACKAGES
do
OLD="$OLD @angular/$package"
NEW="$NEW @angular/$package@$version"
done

echo $version | grep -Eq "^5" && NEW="$NEW rxjs@5.5.5 zone.js@0.8.14" || NEW="$NEW rxjs@6.0.0 zone.js@0.8.26"

npm uninstall --no-save $OLD
npm install --no-save $NEW
npm run build:all
done
echo Testing complete
npm install
6 changes: 6 additions & 0 deletions lib/common/jit-reflector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ export class JitReflector implements CompileReflector {
resolveExternalReference(ref: ExternalReference): any { /* tslint:disable-line prefer-function-over-method */
return ref.runtime;
}

shallowAnnotations = (typeOrFunc: any): any[] => { throw new Error('Not supported in JIT mode'); };

tryAnnotations(typeOrFunc: any): any[] {
return this.annotations(typeOrFunc);
}
}
124 changes: 87 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"clean": "rm -rf dist coverage",
"lint": "tslint --project tsconfig.json",
"build": "npm run clean && tsc",
"build:all": "npm run lint && npm run test && npm run build",
"release": "npm run lint && npm run test && npm run build && standard-version",
"test": "karma start",
"test:watch": "karma start --auto-watch --single-run=false",
"test:debug": "npm run test:watch -- --browsers=Chrome"
"test:debug": "npm run test:watch -- --browsers=Chrome",
"test:angular-versions": "sh build-with-supported-angluars.sh"
},
"repository": {
"type": "git",
Expand All @@ -39,16 +41,16 @@
},
"homepage": "https://github.com/ike18t/ng-mocks#readme",
"peerDependencies": {
"@angular/core": "5.x",
"@angular/forms": "5.x"
"@angular/core": "5.x-6.x",
"@angular/forms": "5.x-6.x"
},
"devDependencies": {
"@angular/common": "5.x",
"@angular/compiler": "5.x",
"@angular/core": "5.x",
"@angular/forms": "5.x",
"@angular/platform-browser": "5.x",
"@angular/platform-browser-dynamic": "5.x",
"@angular/common": "6.x",
"@angular/compiler": "6.x",
"@angular/core": "6.x",
"@angular/forms": "6.x",
"@angular/platform-browser": "6.x",
"@angular/platform-browser-dynamic": "6.x",
"@types/core-js": "^0.9.43",
"@types/jasmine": "^2.5.53",
"@types/node": "^8.0.17",
Expand All @@ -60,10 +62,10 @@
"karma-jasmine-html-reporter": "^0.2.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-typescript": "^3.0.9",
"rxjs": "5.5.5",
"rxjs": "^6.0.0",
"standard-version": "^4.2.0",
"tslint": "^5.5.0",
"typescript": "2.6.x",
"zone.js": "^0.8.14"
"zone.js": "^0.8.26"
}
}

0 comments on commit 5bc9331

Please sign in to comment.