Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport Inject Testing Helper #166

Open
wants to merge 41 commits into
base: 3.x
Choose a base branch
from
Open

Conversation

aciccarello
Copy link
Collaborator

@aciccarello aciccarello commented Oct 20, 2016

Started work on test helpers. Inject was straightforward but TestBed will be a larger undertaking.

Partial fix for #93

aciccarello and others added 27 commits September 22, 2016 13:37
…#156)

To clarify the confusion of ngParty#139, change documentation to make it more
clear that inputs are optional. Add information to the begining of the
decorator descriptions above the existing note in the description of the
decorator parameters to make the information more visible.
* Some testing documentation

* Update README.md
…oth global and module type definitions (ngParty#167)

- now it will work for both type defs for angular ( from typings or from npm @types/angular )
- ofc you can use just one not both types from typings and @types/angular
- if you are using @types you have to introduce within your tests `import * as angular from 'angular'` to be able to do `angular.mock....`, angular is no longer exposed on global

* fix(manual_typings): revert auto from namespace back to module
…js or other polyfill

- update docs and tweak error message if Reflect.metadata isn't present
fix(manual_typings/globals): remove Type alias from globals and add i…
… so angular is loaded not from global namespace

- remove bash script for appending manual typings to core.d.ts which doesn't work
- remove typings
- update packages ( ts, ts-node, mocha, chai )
…t them to source

- bump to typescript@next which resolves issues with type declaration generation
- extract angular module type overrides to separate file which should by included within consumer app
- make global.d.ts truly global
- use only ng.* namespace for types ( no angular )
- update tsconfig to make tsc faster, stronger ;)
- fix compile errors introduced by latest ts 2.1 with better any type inference
- fix NgModule decorator options types to properly allow registering downgraded ng2 entities

Closes ngParty#175, ngParty#177

BREAKING CHANGE:

We now officialy support only angular typings provided via npm `@types/*` and also typescript 2.x

- your existing typings provided by `typings` might not work
- from now on if you wanna use deprecated `provide` function from `ng-metadata/core` with registration within `angular.module().directive|service|filter` you have to explicitly include angular types extension provided by ng-metadata from `node_modules/ng-metadata/manual_typings/angular-extension.d.ts`

Before:
```typescript
// global.d.ts
/// <reference path="../node_modules/ng-metadata/manual_typings/globals.d.ts" />
```

After:
```typescript
/// <reference path="../node_modules/ng-metadata/manual_typings/angular-extension.d.ts" />
```

or you can include it from within your tsconfig.json like this:
```json
{
  "include":[
    "src/**/*.ts"
  ],
  "files": [
    "node_modules/ng-metadata/manual_typings/angular-extension.d.ts"
  ],
  "exclude": [
    "node_modules"
  ]
}
```
- add new super powers for hybrid ng1/ng2
- don't need to create new opaque tokens for downgrade ng2 services, just decorate the service with ngMetadata @Injectable and everything will work == even less refactoring during migrating to ng2 ! yay!
- @input,@output are automatically determined for you so you don't have to specify them within downgradeComponent function
- add convenient helper for upgrading ng1/ngMetadata services to ng2 via `upgradeInjectable`
- allow easily upgradable ngMetadata @Injectable services to ng2 via `upgradeAdapter.upgradeNg1Provider`

All new API's are available under `ng-metadata/upgrade` module namespace

Closes ngParty#178
…pply instead of next tick

- this properly allows to handle user events on input elements like in angular 2

Closes ngParty#171
@aciccarello aciccarello changed the title WIP Backport Testing Helpers Backport Inject Testing Helper Nov 24, 2016
aciccarello and others added 12 commits December 12, 2016 22:35
Node 6 tries to name anonymous functions if assigned to a variable
Windows adds a carriage return character to the end of line which shoud not be included by stringify
* docs(api/upgrade): add docs about AOT upgrade function helpers

* docs(api/recipes/upgrade): add docs how to upgrade with new upgrade/static function helpers

* docs(README): point to new v4 plunker and update rxjs version

Closes ngParty#176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants