Moved spec files to external folder

Change-Id: Idf6489dd0e385764c17e5d9b1b831d7d9fae448c
diff --git a/src/app/hello.spec.ts b/spec/components/hello.spec.ts
similarity index 65%
rename from src/app/hello.spec.ts
rename to spec/components/hello.spec.ts
index d127a2a..44420ac 100644
--- a/src/app/hello.spec.ts
+++ b/spec/components/hello.spec.ts
@@ -1,19 +1,19 @@
 /// <reference path="../../typings/index.d.ts"/>
 
-import { MockBackend } from '@angular/http/testing';
-import {TestBed, async} from '@angular/core/testing';
 import {Router} from '@angular/router';
-import {HelloComponent} from './hello';
-import {LogoutComponent} from './components/logout/logout.component';
-import {StyleConfig} from './config/style.config';
+import {HelloComponent} from '../../src/app/hello';
+import {LogoutComponent} from '../../src/app/components/logout/logout.component';
+import {StyleConfig} from '../../src/app/config/style.config';
 import { Http, BaseRequestOptions } from '@angular/http';
 import {CookieService} from 'angular2-cookie/services/cookies.service';
-import {XosHttp} from './services/rest/xoshttp.service';
-import {InstanceStore} from './services/stores/instance.store';
-import {GlobalEvent} from './services/websockets/websocket.global';
-import {AuthService} from './services/rest/auth.service';
-import {InstanceService} from './services/rest/instance.service';
-import {SliceService} from './services/rest/slices.service';
+import {XosHttp} from '../../src/app/services/rest/xoshttp.service';
+import {InstanceStore} from '../../src/app/services/stores/instance.store';
+import {GlobalEvent} from '../../src/app/services/websockets/websocket.global';
+import {AuthService} from '../../src/app/services/rest/auth.service';
+import {InstanceService} from '../../src/app/services/rest/instance.service';
+import {SliceService} from '../../src/app/services/rest/slices.service';
+import {TestBed, async} from '@angular/core/testing';
+import {MockBackend} from '@angular/http/testing';
 
 describe('hello component', () => {
   beforeEach(async(() => {
diff --git a/src/app/services/helpers/store.service.spec.ts b/spec/services/store.service.spec.ts
similarity index 89%
rename from src/app/services/helpers/store.service.spec.ts
rename to spec/services/store.service.spec.ts
index d70d649..a477817 100644
--- a/src/app/services/helpers/store.service.spec.ts
+++ b/spec/services/store.service.spec.ts
@@ -1,6 +1,7 @@
+///<reference path="../../typings/globals/jasmine/index.d.ts"/>
 
-import {ObservableCollectionHandler} from './store.service';
-import {IWSEvent} from '../../interfaces/ws.interface';
+import {ObservableCollectionHandler} from '../../src/app/services/helpers/store.service';
+import {IWSEvent} from '../../src/app/interfaces/ws.interface';
 import {BehaviorSubject} from 'rxjs';
 
 describe('Service: Observable Collection Handler', () => {
diff --git a/src/index.spec.js b/src/index.spec.js
index e2bdbd0..1b6bb82 100644
--- a/src/index.spec.js
+++ b/src/index.spec.js
@@ -11,16 +11,34 @@
 require('zone.js/dist/jasmine-patch');
 require('zone.js/dist/async-test');
 require('zone.js/dist/fake-async-test');
+
+// loading app files
 const context = require.context('./app', true, /\.(js|ts|tsx)$/);
-// context.keys().forEach(context);
-context.keys().forEach(function(path) {
-  try {
-    context(path);
-  } catch(err) {
-    console.error('[ERROR] WITH SPEC FILE: ', path);
-    console.error(err);
-  }
-});
+context.keys().forEach(context);
+
+// use this for debug
+// context.keys().forEach(function(path) {
+//   try {
+//     context(path);
+//   } catch(err) {
+//     console.error('[ERROR] WITH SPEC FILE: ', path);
+//     console.error(err);
+//   }
+// });
+
+// loading specs
+const specFiles = require.context('../spec', true, /\.(js|ts|tsx)$/);
+specFiles.keys().forEach(specFiles);
+// use this for debug
+// specFiles.keys().forEach(function(path) {
+//   try {
+//     specFiles(path);
+//   } catch(err) {
+//     console.error('[ERROR] WITH SPEC FILE: ', path);
+//     console.error(err);
+//   }
+// });
+
 const testing = require('@angular/core/testing');
 const testingBrowser = require('@angular/platform-browser-dynamic/testing');