style: moved specs to separate folder near tested files
RENAME
packages/core/src/effects/effects.combiner.spec.ts
packages/core/src/effects/specs/effects.combiner.spec.ts
import { of } from 'rxjs';
import { tap } from 'rxjs/operators';
-import { Middleware } from './effects.interface';
-import { combineMiddlewareEffects } from './effects.combiner';
-import { HttpResponse, HttpRequest } from '../http.interface';
-import { Marbles } from '../../../util/marbles.spec-util';
+import { Middleware } from '../effects.interface';
+import { combineMiddlewareEffects } from '../effects.combiner';
+import { HttpResponse, HttpRequest } from '../../http.interface';
+import { Marbles } from '../../../../util/marbles.spec-util';
const createMockRes = () => ({} as HttpResponse);
const createMockReq = (url = '/') => ({ url } as HttpRequest);

RENAME
packages/core/src/effects/effects.factory.spec.ts
packages/core/src/effects/specs/effects.factory.spec.ts
import { mapTo } from 'rxjs/operators';
-import { Effect } from './effects.interface';
-import { EffectFactory } from './effects.factory';
+import { Effect } from '../effects.interface';
+import { EffectFactory } from '../effects.factory';
describe('Effects factory', () => {

RENAME
packages/core/src/error/error.effect.spec.ts
packages/core/src/error/specs/error.effect.spec.ts
import { mapTo } from 'rxjs/operators';
-import { Marbles } from '../../../util/marbles.spec-util';
-import { HttpRequest, HttpResponse } from '../http.interface';
-import { error$, errorEffectProvider } from './error.effect';
-import { HttpError } from './error.model';
+import { Marbles } from '../../../../util/marbles.spec-util';
+import { HttpRequest, HttpResponse } from '../../http.interface';
+import { error$, errorEffectProvider } from '../error.effect';
+import { HttpError } from '../error.model';
const createMockRes = () => ({} as HttpResponse);
const createMockReq = (url = '/') => ({ url } as HttpRequest);

RENAME
packages/core/src/error/error.model.spec.ts
packages/core/src/error/specs/error.model.spec.ts
-import { ExtendableError, HttpError, isHttpError } from './error.model';
+import { ExtendableError, HttpError, isHttpError } from '../error.model';
describe('Error', () => {

RENAME
packages/core/src/response/response.handler.spec.ts
packages/core/src/response/specs/response.handler.spec.ts
-import { HttpRequest, HttpResponse, HttpStatus } from '../http.interface';
-import { handleResponse } from './response.handler';
-import { DEFAULT_HEADERS } from './responseHeaders.factory';
+import { HttpRequest, HttpResponse, HttpStatus } from '../../http.interface';
+import { handleResponse } from '../response.handler';
+import { DEFAULT_HEADERS } from '../responseHeaders.factory';
const createMockResponse = () => ({
writeHead: jest.fn(),

RENAME
packages/core/src/response/responseBody.factory.spec.ts
packages/core/src/response/specs/responseBody.factory.spec.ts
-import { ContentType } from '../util/contentType.util';
-import { bodyFactory } from './responseBody.factory';
+import { ContentType } from '../../util/contentType.util';
+import { bodyFactory } from '../responseBody.factory';
describe('Response body factory', () => {

RENAME
packages/core/src/response/responseContentType.factory.spec.ts
packages/core/src/response/specs/responseContentType.factory.spec.ts
import * as fs from 'fs';
-import { ContentType } from '../util/contentType.util';
-import { DEFAULT_CONTENT_TYPE, contentTypeFactory, getMimeType } from './responseContentType.factory';
+import { ContentType } from '../../util/contentType.util';
+import { DEFAULT_CONTENT_TYPE, contentTypeFactory, getMimeType } from '../responseContentType.factory';
describe('Response content-type factory', () => {
@@ -18,7 +18,7 @@ describe('Response content-type factory', () => {
it('#getMimeType detects mime-type from buffer', () => {
// given
- const body = fs.readFileSync(__dirname + '/../../../../assets/logo.png');
+ const body = fs.readFileSync(__dirname + '/../../../../../assets/logo.png');
const path = '/test/index.html';
// when

RENAME
packages/core/src/response/responseHeaders.factory.spec.ts
packages/core/src/response/specs/responseHeaders.factory.spec.ts
-import { DEFAULT_HEADERS, headersFactory } from './responseHeaders.factory';
+import { DEFAULT_HEADERS, headersFactory } from '../responseHeaders.factory';
describe('Response headers factory', () => {

RENAME
packages/core/src/router/queryParams.factory.spec.ts
packages/core/src/router/specs/queryParams.factory.spec.ts
-import { queryParamsFactory } from './queryParams.factory';
+import { queryParamsFactory } from '../queryParams.factory';
describe('queryParamsFactory', () => {
test('should return empty object when passed URL with no valid params', () => {

RENAME
packages/core/src/router/router.factory.spec.ts
packages/core/src/router/specs/router.factory.spec.ts
import { mapTo } from 'rxjs/operators';
-import { EffectFactory } from '../effects/effects.factory';
-import { Effect, Middleware } from '../effects/effects.interface';
-import { RouteEffect, RouteEffectGroup, Routing } from './router.interface';
-import { factorizeRouting, combineRoutes } from './router.factory';
+import { EffectFactory } from '../../effects/effects.factory';
+import { Effect, Middleware } from '../../effects/effects.interface';
+import { RouteEffect, RouteEffectGroup, Routing } from '../router.interface';
+import { factorizeRouting, combineRoutes } from '../router.factory';
describe('Router factory', () => {
let effectsCombiner;
beforeEach(() => {
- jest.unmock('../effects/effects.combiner.ts');
- effectsCombiner = require('../effects/effects.combiner');
+ jest.unmock('../../effects/effects.combiner.ts');
+ effectsCombiner = require('../../effects/effects.combiner');
});
test('#factorizeRouting factorizes routing with nested groups', () => {

RENAME
packages/core/src/router/router.helper.spec.ts
packages/core/src/router/specs/router.helper.spec.ts
-import { isRouteEffectGroup, isRouteCombinerConfig } from './router.helpers';
+import { isRouteEffectGroup, isRouteCombinerConfig } from '../router.helpers';
describe('Router helper', () => {

RENAME
packages/core/src/router/router.spec.ts
packages/core/src/router/specs/router.spec.ts
import { mapTo, tap, map } from 'rxjs/operators';
-import { Effect, Middleware } from '../effects/effects.interface';
-import { findRoute, resolveRouting } from './router';
-import { HttpRequest, HttpResponse, HttpMethod } from '../http.interface';
-import { RouteMatched, Routing } from './router.interface';
+import { Effect, Middleware } from '../../effects/effects.interface';
+import { findRoute, resolveRouting } from '../router';
+import { HttpRequest, HttpResponse, HttpMethod } from '../../http.interface';
+import { RouteMatched, Routing } from '../router.interface';
describe('Router', () => {
@@ -81,10 +81,10 @@ describe('Router', () => {
let queryFactory;
beforeEach(() => {
- jest.unmock('./router.ts');
- jest.unmock('../router/queryParams.factory');
- router = require('./router.ts');
- queryFactory = require('../router/queryParams.factory');
+ jest.unmock('../router.ts');
+ jest.unmock('../queryParams.factory');
+ router = require('../router.ts');
+ queryFactory = require('../queryParams.factory');
});
test('resolves found effect', done => {

RENAME
packages/core/src/router/urlParams.factory.spec.ts
packages/core/src/router/specs/urlParams.factory.spec.ts
-import { factorizeRegExpWithParams } from './urlParams.factory';
+import { factorizeRegExpWithParams } from '../urlParams.factory';
describe('Url parameters factory', () => {

style: moved specs to separate folder near tested files