{"action":"created","issue":{"url":"https://api.github.com/repos/log4js-node/log4js-node/issues/685","repository_url":"https://api.github.com/repos/log4js-node/log4js-node","labels_url":"https://api.github.com/repos/log4js-node/log4js-node/issues/685/labels{/name}","comments_url":"https://api.github.com/repos/log4js-node/log4js-node/issues/685/comments","events_url":"https://api.github.com/repos/log4js-node/log4js-node/issues/685/events","html_url":"https://github.com/log4js-node/log4js-node/issues/685","id":304579176,"number":685,"title":"karma, jasmine, typescript: Problem with log4js configuration","user":{"login":"jocafi","id":10840335,"avatar_url":"https://avatars0.githubusercontent.com/u/10840335?v=4","gravatar_id":"","url":"https://api.github.com/users/jocafi","html_url":"https://github.com/jocafi","followers_url":"https://api.github.com/users/jocafi/followers","following_url":"https://api.github.com/users/jocafi/following{/other_user}","gists_url":"https://api.github.com/users/jocafi/gists{/gist_id}","starred_url":"https://api.github.com/users/jocafi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jocafi/subscriptions","organizations_url":"https://api.github.com/users/jocafi/orgs","repos_url":"https://api.github.com/users/jocafi/repos","events_url":"https://api.github.com/users/jocafi/events{/privacy}","received_events_url":"https://api.github.com/users/jocafi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-12T23:42:03Z","updated_at":"2018-03-13T13:35:41Z","closed_at":null,"author_association":"NONE","body":"I am trying to run my unit test, but I receive the error below:\r\n\r\n> Chrome 64.0.3282 (Mac OS X 10.12.6) ERROR\r\n>   {\r\n>     \"message\": \"An error was thrown in afterAll\\nError: Problem with log4js configuration: ({ appenders: { out: { type: 'console' } },\\n    at <Jasmine>\\n    at tests.forEach (/var/folders/r0/q3wy_02d37q2n5zkf513_hnw0000gn/T/karma-typescript-bundle-31931lLiSPkJ8RypR.js:1509:15)\\n    at <Jasmine>\\n    at Configuration.throwExceptionIf (/var/folders/r0/q3wy_02d37q2n5zkf513_hnw0000gn/T/karma-typescript-bundle-31931lLiSPkJ8RypR.js:1507:11)\\n    at Configuration.tryLoading (/var/folders/r0/q3wy_02d37q2n5zkf513_hnw0000gn/T/karma-typescript-bundle-31931lLiSPkJ8RypR.js:1521:12)\\n    at Configuration ...\r\n\r\nMy test class is very simple:\r\n\r\n```\r\nimport { configure, getLogger, Logger } from \"log4js\";\r\n\r\ndescribe(\"Logging Service\", () => {\r\n  let log: Logger;\r\n\r\n  beforeAll(()=> {\r\n    configure({\r\n      appenders: {\r\n        out: { type: 'console' }\r\n      },\r\n      categories: {\r\n        default: {appenders: ['out'], level: 'info'}\r\n      }\r\n    });\r\n\r\n    this.log = getLogger(\"LoggingService\");\r\n  });\r\n\r\n  it(\"should log\", () =>  {\r\n    this.log.info(\"Test.\");\r\n  });\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/log4js-node/log4js-node/issues/comments/372666829","html_url":"https://github.com/log4js-node/log4js-node/issues/685#issuecomment-372666829","issue_url":"https://api.github.com/repos/log4js-node/log4js-node/issues/685","id":372666829,"user":{"login":"jocafi","id":10840335,"avatar_url":"https://avatars0.githubusercontent.com/u/10840335?v=4","gravatar_id":"","url":"https://api.github.com/users/jocafi","html_url":"https://github.com/jocafi","followers_url":"https://api.github.com/users/jocafi/followers","following_url":"https://api.github.com/users/jocafi/following{/other_user}","gists_url":"https://api.github.com/users/jocafi/gists{/gist_id}","starred_url":"https://api.github.com/users/jocafi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jocafi/subscriptions","organizations_url":"https://api.github.com/users/jocafi/orgs","repos_url":"https://api.github.com/users/jocafi/repos","events_url":"https://api.github.com/users/jocafi/events{/privacy}","received_events_url":"https://api.github.com/users/jocafi/received_events","type":"User","site_admin":false},"created_at":"2018-03-13T13:35:40Z","updated_at":"2018-03-13T13:35:40Z","author_association":"NONE","body":"Hi @cula ,\r\n\r\n I am not using mocha. I am using Jasmine, instead.\r\n\r\nI tried to run your code and got the error below:\r\n\r\n> Chrome 64.0.3282 (Mac OS X 10.12.6) ERROR\r\n>   {\r\n>     \"message\": \"An error was thrown in afterAll\\nUncaught Error: Problem with log4js configuration: ({ appenders: { out: { type: 'console' } },\\n  categories: { default: { appenders: [ 'out' ], level: 'info' } } }) - appender \\\"[object Object]\\\" could not be loaded (error was: Error: Can't find ./appenders/console [undefined] (required by <PROJECT_DIR>//node_modules/log4js/lib/configuration.js))\",\r\n>     \"str\": \"An error was thrown in afterAll\\nUncaught Error: Problem with log4js configuration: ({ appenders: { out: { type: 'console' } },\\n  categories: { default: { appenders: [ 'out' ], level: 'info' } } }) - appender \\\"[object Object]\\\" could not be loaded (error was: Error: Can't find ./appenders/console [undefined] (required by <PROJECT_DIR>/node_modules/log4js/lib/configuration.js))\"\r\n>   }\r\n\r\n I am using the versions:\r\nMacOS: 10.12.6\r\nnodejs: 8.9.3\r\nnpm: 5.71\r\n\r\n```\r\n  \"dependencies\": {\r\n    \"@types/dotenv\": \"^4.0.2\",\r\n    \"@types/node\": \"^9.4.7\",\r\n    \"dotenv\": \"^5.0.1\",\r\n    \"firebase\": \"^4.10.1\",\r\n    \"log4js\": \"^2.5.3\",\r\n    \"rxjs\": \"^5.5.6\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"@types/jasmine\": \"^2.8.6\",\r\n    \"jasmine-core\": \"^3.1.0\",\r\n    \"karma\": \"^2.0.0\",\r\n    \"karma-chrome-launcher\": \"^2.2.0\",\r\n    \"karma-jasmine\": \"^1.1.1\",\r\n    \"karma-typescript\": \"^3.0.12\",\r\n    \"rimraf\": \"^2.6.2\",\r\n    \"ts-node\": \"^5.0.1\",\r\n    \"typescript\": \"^2.7.2\"\r\n  }\r\n```\r\n**karma.conf.js**\r\n\r\n```\r\nmodule.exports = function(config) {\r\n    config.set({\r\n        autoWatch: true,\r\n        frameworks: [\"jasmine\", \"karma-typescript\"],\r\n        files: [\r\n            { pattern: \"src/**/*.ts\" }, // *.tsx for React Jsx\r\n            { pattern: \"test/**/*.ts\" }\r\n        ],\r\n\r\n        karmaTypescriptConfig: {\r\n            tsconfig: \"./tsconfig.test.json\"\r\n        },\r\n\r\n        preprocessors: {\r\n            \"src/**/*.ts\": [\"karma-typescript\", \"coverage\"], // *.tsx for React Jsx\r\n            \"test/**/*.ts\": [\"karma-typescript\"]\r\n        },\r\n        reporters: [\"progress\", \"coverage\", \"karma-typescript\"],\r\n        browsers: [\"Chrome\"]\r\n    });\r\n};\r\n```\r\n\r\n**tsconfig.test.json**\r\n\r\n```\r\n{\r\n    \"compilerOptions\": {\r\n        \"module\": \"commonjs\",\r\n        \"esModuleInterop\": true,\r\n        \"target\": \"es2015\",\r\n        \"declaration\": true,\r\n        \"noImplicitAny\": true,\r\n        \"moduleResolution\": \"node\",\r\n        \"sourceMap\": true,\r\n        \"outDir\": \"dist\",\r\n        \"baseUrl\": \".\",\r\n        \"paths\": {\r\n            \"*\": [\r\n                \"node_modules/*\",\r\n                \"src/types/*\"\r\n            ]\r\n        }\r\n    },\r\n    \"include\": [\r\n        \"src/**/*\",\r\n        \"test/**/*\"\r\n    ]\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"jocafi"}}