Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
import { NgxLoggerLevel } from 'ngx-logger';
export const environment = {
production: false,
ngxLoggerConfig: {
level: NgxLoggerLevel.DEBUG,
disableConsoleLogging: false
},
xsrf: {
headerName: 'ATLASMAP-XSRF-TOKEN',
cookieName: 'ATLASMAP-XSRF-COOKIE',
defaultTokenValue: 'awesome',
},
backendUrls: {
atlasServiceUrl: 'http://localhost:8585/v2/atlas/',
javaInspectionServiceUrl: 'http://localhost:8585/v2/atlas/java/',
xmlInspectionServiceUrl: 'http://localhost:8585/v2/atlas/xml/',
jsonInspectionServiceUrl: 'http://localhost:8585/v2/atlas/json/',
},
};
handleLog(log: LogEvent) {
switch (log.logType) {
case NgxLoggerLevel.TRACE:
this.logger.trace(log.logMessage);
break;
case NgxLoggerLevel.DEBUG:
this.logger.debug(log.logMessage);
break;
case NgxLoggerLevel.INFO:
this.logger.info(log.logMessage);
break;
case NgxLoggerLevel.LOG:
this.logger.log(log.logMessage);
break;
case NgxLoggerLevel.WARN:
this.logger.warn(log.logMessage);
break;
case NgxLoggerLevel.ERROR:
this.logger.error(log.logMessage);
break;
case NgxLoggerLevel.FATAL:
this.logger.fatal(log.logMessage);
beforeEach(() => {
TestBed.resetTestEnvironment();
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
TestBed.configureTestingModule({
imports: [LoggerModule.forRoot({ level: NgxLoggerLevel.DEBUG })],
providers: [
ErrorHandlerService,
FieldActionService,
MappingManagementService,
NGXLogger,
],
});
cfg = ConfigModel.getConfig();
cfg.clearDocs();
cfg.mappings = new MappingDefinition();
cfg.errorService = TestBed.get(ErrorHandlerService);
cfg.fieldActionService = TestBed.get(FieldActionService);
cfg.fieldActionService.cfg = cfg;
cfg.logger = TestBed.get(NGXLogger);
const twitter = new DocumentDefinition();
beforeEach(() => {
TestBed.resetTestEnvironment();
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
TestBed.configureTestingModule({
imports: [HttpClientModule, HttpClientTestingModule, LoggerModule.forRoot({ level: NgxLoggerLevel.DEBUG })],
providers: [
ErrorHandlerService,
FieldActionService,
NGXLogger,
],
});
jasmine.getFixtures().fixturesPath = 'base/test-resources/fieldActions';
action = new FieldActionDefinition();
mapping = new MappingModel();
mapping.sourceFields.splice(0);
source = new Field();
mapping.addField(source, false);
mapping.targetFields.splice(0);
target = new Field();
mapping.addField(target, false);
});
import { LoggerConfig, NgxLoggerLevel } from 'ngx-logger';
import { BCH, BTC, Chain, tBCH, tBTC } from '../app/types/chains';
const loggingSettings: LoggerConfig = {
serverLoggingUrl: '/api/logs/insight',
level: NgxLoggerLevel.DEBUG,
serverLogLevel: NgxLoggerLevel.ERROR
};
const initialChain: Chain = BCH;
const expectedChains: Chain[] = [BCH, tBCH, BTC, tBTC];
export const environment = {
apiPrefix: 'https://api.bitcore.io/api',
ratesApi: 'https://bitpay.com/api/rates/bch',
production: true,
debugRouting: false,
loggingSettings,
initialDisplayValueCode: initialChain.code,
initialChain,
expectedChains,
isDebugEnabled(): boolean {
return [NgxLoggerLevel.DEBUG, NgxLoggerLevel.TRACE].includes(this.logger.getConfigSnapshot().level);
}
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientModule, HttpClientTestingModule, LoggerModule.forRoot({level: NgxLoggerLevel.DEBUG})],
providers: [
DataMapperAppExampleHostComponent,
DocumentManagementService,
ErrorHandlerService,
FieldActionService,
FileManagementService,
InitializationService,
MappingManagementService,
NGXLogger,
MappingIdentifierService,
{provide: ActivatedRoute, useValue: testActivatedRoute}
],
});
});