1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

fixing testing bug

This commit is contained in:
Braun Patrik 2016-05-04 20:10:28 +02:00
parent 43d6453d6d
commit 6949a8c1e5
3 changed files with 18 additions and 8 deletions

View File

@ -8,13 +8,13 @@ import {
} from '@angular/core/testing'; } from '@angular/core/testing';
import {provide} from '@angular/core'; import {provide} from '@angular/core';
import {AuthenticationService} from "./authentication.service.ts";
import {UserService} from "./user.service.ts"; import {UserService} from "./user.service.ts";
import {User} from "../../../../common/entities/User"; import {User} from "../../../../common/entities/User";
import {Message} from "../../../../common/entities/Message"; import {Message} from "../../../../common/entities/Message";
import "rxjs/Rx"; import "rxjs/Rx";
import {LoginCredential} from "../../../../common/entities/LoginCredential"; import {LoginCredential} from "../../../../common/entities/LoginCredential";
import {AuthenticationService} from "./authentication.service";
class MockUserService { class MockUserService {
public login(credential:LoginCredential){ public login(credential:LoginCredential){

View File

@ -11,16 +11,21 @@
Error.stackTraceLimit = Infinity; Error.stackTraceLimit = Infinity;
require('core-js'); require('core-js');
// Typescript emit helpers polyfill
require('ts-helpers');
require('zone.js/dist/zone.js'); require('zone.js/dist/zone.js');
require('zone.js/dist/long-stack-trace-zone.js'); require('zone.js/dist/long-stack-trace-zone.js');
require('zone.js/dist/jasmine-patch.js'); require('zone.js/dist/jasmine-patch.js');
require('zone.js/dist/async-test');
var testing = require('@angular/core/testing'); var testing = require('@angular/core/testing');
var browser = require('@angular/platform-browser/testing'); var browser = require('@angular/platform-browser-dynamic/testing');
testing.setBaseTestProviders( testing.setBaseTestProviders(
browser.TEST_BROWSER_PLATFORM_PROVIDERS, browser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
browser.TEST_BROWSER_APPLICATION_PROVIDERS); browser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS
);
Object.assign(global, testing); Object.assign(global, testing);
/* /*

View File

@ -12,17 +12,22 @@ Error.stackTraceLimit = Infinity;
// Prefer CoreJS over the polyfills above // Prefer CoreJS over the polyfills above
require('core-js'); require('core-js');
// Typescript emit helpers polyfill
require('ts-helpers');
require('zone.js/dist/zone.js'); require('zone.js/dist/zone.js');
require('zone.js/dist/long-stack-trace-zone.js'); require('zone.js/dist/long-stack-trace-zone.js');
require('zone.js/dist/jasmine-patch.js'); require('zone.js/dist/jasmine-patch.js');
require('zone.js/dist/async-test');
var testing = require('@angular/core/testing'); var testing = require('@angular/core/testing');
var browser = require('@angular/platform-browser/testing'); var browser = require('@angular/platform-browser-dynamic/testing');
testing.setBaseTestProviders( testing.setBaseTestProviders(
browser.TEST_BROWSER_PLATFORM_PROVIDERS, browser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
browser.TEST_BROWSER_APPLICATION_PROVIDERS); browser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS
);
Object.assign(global, testing); Object.assign(global, testing);
/* /*