Skip to content

Commit

Permalink
feat(http): correction for imports
Browse files Browse the repository at this point in the history
  • Loading branch information
tenretC committed Mar 29, 2018
1 parent f3684db commit 464566a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 61 deletions.
1 change: 1 addition & 0 deletions packages/stark-build/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"alwaysStrict": true,
Expand Down
4 changes: 3 additions & 1 deletion packages/stark-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
"npm": ">=5.3.0"
},
"dependencies": {
"@ngrx/store": "5.2.0",
"@types/core-js": "0.9.46",
"@types/jasmine": "2.8.6",
"@types/node": "6.0.102",
"@types/uuid": "3.4.3",
"@ngrx/store": "5.2.0",
"cerialize": "0.1.18",
"class-validator": "0.7.3",
"core-js": "2.5.3",
Expand Down Expand Up @@ -57,6 +58,7 @@
"@angular/platform-browser-dynamic": "5.x"
},
"scripts": {
"ngc": "ngc",
"lint": "tslint --config tslint.json --project ./tsconfig.json --format codeFrame",
"test-fast": "node ./node_modules/@nationalbankbelgium/stark-testing/node_modules/karma/bin/karma start ./karma.conf.typescript.js",
"test-fast:ci": "node ./node_modules/@nationalbankbelgium/stark-testing/node_modules/karma/bin/karma start karma.conf.typescript.ci.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/stark-core/src/http/http.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NgModule } from "@angular/core";
import { HttpClient, HttpClientModule } from "@angular/common/http";
import { StarkHttpServiceImpl, starkHttpServiceName } from "./service/index";
import { StarkHttpServiceImpl, starkHttpServiceName } from "./services/index";

// FIXME: remove this factory once LoggingService and SessionService are implemented
const starkHttpServiceFactory: any = (httpClient: HttpClient) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

import * as moment from "moment";
import moment from "moment";
import { autoserialize, autoserializeAs } from "cerialize";
import { StarkLogMessageType } from "./log-message-type.entity";
import { StarkLogMessage } from "./log-message.entity.intf";
Expand Down
57 changes: 0 additions & 57 deletions packages/stark-core/src/logging/reducers/logging.reducer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ describe("Reducer: LoggingReducer", () => {
expect(initialState.messages.length).toBe(2);

deepFreeze(initialState); //Enforce immutability
// const payload: any = { message: new StarkLogMessageImpl(StarkLogMessageType.DEBUG, "Message N", "") };
// deepFreeze(payload); //Enforce immutability
//
// // Send the LOG_MESSAGE action to the loggingReducer
// const changedState: StarkLogging = loggingReducer(initialState, {
// type: StarkLoggingActions.LOG_MESSAGE,
// payload
// });

const changedState: StarkLogging = loggingReducer(
initialState,
new LogMessage(new StarkLogMessageImpl(StarkLogMessageType.DEBUG, "Message N", ""))
Expand All @@ -46,14 +37,6 @@ describe("Reducer: LoggingReducer", () => {
});

it("should add the given messages to the array even if the state is not defined", () => {
// const payload: any = { message: new StarkLogMessageImpl(StarkLogMessageType.DEBUG, "Message N", "") };
// deepFreeze(payload); //Enforce immutability
//
// // Send the LOG_MESSAGE action to the loggingReducer
// const changedState: StarkLogging = loggingReducer(<any>undefined, {
// type: StarkLoggingActions.LOG_MESSAGE,
// payload
// });
const changedState: StarkLogging = loggingReducer(
<any>undefined,
new LogMessage(new StarkLogMessageImpl(StarkLogMessageType.DEBUG, "Message N", ""))
Expand All @@ -79,14 +62,6 @@ describe("Reducer: LoggingReducer", () => {
expect(initialState.messages.length).toBe(5);

deepFreeze(initialState); //Enforce immutability
// const payload: any = { numberOfMessagesToFlush: 3 };
// deepFreeze(payload); //Enforce immutability
//
// // Send the FLUSH_LOG action to the loggingReducer
// const changedState: StarkLogging = loggingReducer(initialState, {
// type: StarkLoggingActions.FLUSH_LOG,
// payload
// });
const changedState: StarkLogging = loggingReducer(initialState, new FlushLogMessages(3));

expect(changedState.messages.length).toBe(2);
Expand All @@ -102,46 +77,14 @@ describe("Reducer: LoggingReducer", () => {
initialState.applicationId = "whatever";

deepFreeze(initialState); //Enforce immutability
// const payload: any = { applicationId: "new appID" };
// deepFreeze(payload); //Enforce immutability

// Send the LOGGING_SET_APPLICATION_ID action to the loggingReducer
// const changedState: StarkLogging = loggingReducer(initialState, {
// type: StarkLoggingActions.LOGGING_SET_APPLICATION_ID,
// payload
// });
const changedState: StarkLogging = loggingReducer(initialState, new SetApplicationId("new appID"));

expect(changedState.applicationId).toBe("new appID");
});
it("should set the application id even if the state is not defined", () => {
// const payload: any = { applicationId: "new appID" };
// deepFreeze(payload); //Enforce immutability
//
// // Send the LOGGING_SET_APPLICATION_ID action to the loggingReducer
// const changedState: StarkLogging = loggingReducer(<any>undefined, {
// type: StarkLoggingActions.LOGGING_SET_APPLICATION_ID,
// payload
// });
const changedState: StarkLogging = loggingReducer(<any>undefined, new SetApplicationId("new appID"));

expect(changedState.applicationId).toBe("new appID");
});
});

// describe("on any other Action", () => {
// it("should invoke the default state", () => {
// const initialState: StarkLogging = starkLogging;
// deepFreeze(initialState); //Enforce immutability
//
// // Send the MOCK_ACTION action to the loggingReducer
// const changedState: StarkLogging = loggingReducer(initialState, {
// type: "MOCK_ACTION"
// });
//
// loggingReducer
//
// expect(changedState).toBe(initialState);
// });
// });
});
2 changes: 1 addition & 1 deletion packages/stark-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"allowEmptyCodegenFiles": false,
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
// "flatModuleOutFile": "stark-core.js",
"flatModuleOutFile": "stark-core.js",
"flatModuleId": "@nationalbankbelgium/stark-core"
}
}

0 comments on commit 464566a

Please sign in to comment.