Skip to content

Commit

Permalink
chore(angular): Upgrade to angular rc.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Jul 4, 2016
1 parent 03f134f commit 61fc244
Show file tree
Hide file tree
Showing 52 changed files with 329 additions and 301 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
},
"homepage": "https://github.com/ubiquits/ubiquits#readme",
"dependencies": {
"@angular/common": "2.0.0-rc.2",
"@angular/compiler": "2.0.0-rc.2",
"@angular/core": "2.0.0-rc.2",
"@angular/http": "2.0.0-rc.2",
"@angular/platform-browser": "2.0.0-rc.2",
"@angular/platform-browser-dynamic": "2.0.0-rc.2",
"@angular/router": "2.0.0-rc.2",
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.2",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.4",
"chalk": "^1.1.3",
"chance": "^1.0.3",
"class-validator": "^0.4.0-alpha.3",
Expand All @@ -55,10 +55,10 @@
"zone.js": "^0.6.12"
},
"devDependencies": {
"@ubiquits/toolchain": "^0.1.35",
"@ubiquits/toolchain": "^0.1.36",
"proxyquire": "^1.7.10"
},
"directories": {
"doc": "docs"
}
}
}
26 changes: 14 additions & 12 deletions src/browser/stores/http.store.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fit, it, inject, beforeEachProviders, expect, describe } from '@angular/core/testing';
import { inject, addProviders, async } from '@angular/core/testing';
import { MockBackend, MockConnection } from '@angular/http/testing';
import { Http, BaseRequestOptions, Response } from '@angular/http';
import { Injectable, Injector } from '@angular/core';
Expand Down Expand Up @@ -38,9 +38,11 @@ const providers = [

describe('Http store', () => {

beforeEachProviders(() => providers);
beforeEach(() => {
addProviders(providers);
});

it('Retrieves a collection of models from http', inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {
it('Retrieves a collection of models from http', async(inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {

let connection: MockConnection;
b.connections.subscribe((c: MockConnection) => connection = c);
Expand Down Expand Up @@ -69,9 +71,9 @@ describe('Http store', () => {

return testPromise;

}));
})));

it('Logs error on failed collection retrieval', inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {
it('Logs error on failed collection retrieval', async(inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {

let logSpy = spyOn((s as any).logger, 'error');

Expand All @@ -97,9 +99,9 @@ describe('Http store', () => {

return testPromise;

}));
})));

it('Retrieves a single model from http', inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {
it('Retrieves a single model from http', async(inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {

let connection: MockConnection;
b.connections.subscribe((c: MockConnection) => connection = c);
Expand All @@ -126,9 +128,9 @@ describe('Http store', () => {

return testPromise;

}));
})));

it('Logs error on failed model retrieval', inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {
it('Logs error on failed model retrieval', async(inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {

let logSpy = spyOn((s as any).logger, 'error');

Expand All @@ -144,9 +146,9 @@ describe('Http store', () => {

return testPromise;

}));
})));

it('Saves a single model with http', inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {
it('Saves a single model with http', async(inject([TestHttpStore, MockBackend], (s: TestHttpStore, b: MockBackend) => {

let connection: MockConnection;
b.connections.subscribe((c: MockConnection) => connection = c);
Expand Down Expand Up @@ -179,6 +181,6 @@ describe('Http store', () => {

return testPromise;

}));
})));

});
1 change: 0 additions & 1 deletion src/browser/stores/http.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Logger } from '../../common/services/logger.service';
import { Collection } from '../../common/models/collection';
import 'rxjs/add/operator/toPromise';


@Injectable()
export abstract class HttpStore<T extends AbstractModel> extends AbstractStore<T> {

Expand Down
2 changes: 1 addition & 1 deletion src/browser/vendor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import '@angular/core';
import '@angular/common';
import '@angular/http';
import '@angular/router-deprecated';
// RxJS
import 'rxjs';
// RxJS
// Other vendors for example jQuery, Lodash or Bootstrap
// You can import js, ts, css, sass, ...
1 change: 0 additions & 1 deletion src/common/models/collection.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { it, describe, beforeEach, expect } from '@angular/core/testing';
import { AbstractModel } from './model';
import { Collection } from './collection';
import { Primary } from './types/primary.decorator';
Expand Down
1 change: 0 additions & 1 deletion src/common/models/model.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { it, describe, expect, beforeEach } from '@angular/core/testing';
import { UUID, AbstractModel } from './model';
import { Primary } from './types/primary.decorator';
import Moment = moment.Moment;
Expand Down
3 changes: 0 additions & 3 deletions src/common/models/model.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { Collection } from './collection';

import { RegistryEntityStatic } from '../registry/entityRegistry';
import { RelationType, Relation } from './relations/index';
import { ModelMetadata } from '../metadata/metadata';

export type identifier = string | number | symbol;
Expand Down
1 change: 0 additions & 1 deletion src/common/models/relations/relations.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { it, describe, expect, beforeEach } from '@angular/core/testing';
import Moment = moment.Moment;
import { HasOne } from './hasOne.decorator';
import { AbstractModel } from '../model';
Expand Down
2 changes: 1 addition & 1 deletion src/common/registry/decorators.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { registry, EntityType, RegistryEntityStatic, EntityMetadata } from './entityRegistry';
import { registry, EntityType, EntityMetadata } from './entityRegistry';
import { ModelMetadata } from '../metadata/metadata';

function entityRegistryFunction(type: EntityType, metadata?: EntityMetadata): ClassDecorator {
Expand Down
1 change: 0 additions & 1 deletion src/common/registry/entityRegistry.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { it, expect, describe } from '@angular/core/testing';
import { EntityRegistry, EntityType, registry } from './entityRegistry';
import { Model, Controller, Seeder, Middleware, Migration, Store, Service } from './decorators';
import { AbstractModel } from '../models/model';
Expand Down
6 changes: 3 additions & 3 deletions src/common/services/consoleLogger.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { it, expect, describe} from '@angular/core/testing';
import { it, expect, describe } from '@angular/core/testing';
import { ConsoleLogger, isBrowser } from './consoleLogger.service';
import {stripColor, hasColor} from 'chalk';
import Spy = jasmine.Spy;
import { stripColor, hasColor } from 'chalk';
import { LogLevel } from './logger.service';
import Spy = jasmine.Spy;

describe('Console Logger', () => {

Expand Down
2 changes: 1 addition & 1 deletion src/common/services/consoleLogger.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Logger, LogLevel } from './logger.service';
import { yellow, red, bgRed, magenta, gray, blue, bgYellow } from 'chalk';
import { yellow, red, bgRed, magenta, gray, blue } from 'chalk';
import { inspect } from 'util';
import { Injectable } from '@angular/core';
import * as moment from 'moment';
Expand Down
25 changes: 16 additions & 9 deletions src/common/services/logger.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger, LogLevel } from './logger.service';
import { Injectable } from '@angular/core';
import { it, inject, beforeEachProviders, expect, describe } from '@angular/core/testing';
import { inject, addProviders } from '@angular/core/testing';
import { Service } from '../registry/decorators';

@Injectable()
Expand All @@ -20,31 +20,38 @@ export class LoggerMock extends Logger {
@Injectable()
class TestClass {

constructor(public logger:Logger){
constructor(public logger: Logger) {

}

}


const providers = [
TestClass,
{provide: Logger, useClass: LoggerMock},
];

describe('Logger mock', () => {

beforeEachProviders(() => providers);
beforeEach(() => {
addProviders(providers);
});

it('Can be injected with the Logger token', inject([TestClass], (c: TestClass) => {

let consoleSpy = spyOn(console, 'log');

expect(c instanceof TestClass).toBe(true);
expect(c.logger instanceof Logger).toBe(true);
expect(c.logger instanceof LoggerMock).toBe(true);
expect(c.logger.debug() instanceof Logger).toBe(true);
expect(consoleSpy).not.toHaveBeenCalled();
expect(c instanceof TestClass)
.toBe(true);
expect(c.logger instanceof Logger)
.toBe(true);
expect(c.logger instanceof LoggerMock)
.toBe(true);
expect(c.logger.debug() instanceof Logger)
.toBe(true);
expect(consoleSpy)
.not
.toHaveBeenCalled();

}));
});
1 change: 0 additions & 1 deletion src/common/services/logger.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Injectable } from '@angular/core';
import { Service } from '../registry/decorators';
import { AbstractService } from './service';

/**
Expand Down
6 changes: 3 additions & 3 deletions src/common/stores/mock.store.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { identifier, ModelStatic, AbstractModel } from '../models/model';
import { Collection } from '../models/collection';
import { AbstractStore, Query } from './store';
import {Injector} from '@angular/core';
import {Chance} from 'chance';
import { AbstractStore } from './store';
import { Injector } from '@angular/core';
import { Chance } from 'chance';
import * as _ from 'lodash';

export type ChanceInstance = Chance.Chance;
Expand Down
Loading

0 comments on commit 61fc244

Please sign in to comment.