{"action":"created","issue":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/1654","repository_url":"https://api.github.com/repos/typeorm/typeorm","labels_url":"https://api.github.com/repos/typeorm/typeorm/issues/1654/labels{/name}","comments_url":"https://api.github.com/repos/typeorm/typeorm/issues/1654/comments","events_url":"https://api.github.com/repos/typeorm/typeorm/issues/1654/events","html_url":"https://github.com/typeorm/typeorm/issues/1654","id":300349506,"number":1654,"title":"Exclude pattern in ormconfig","user":{"login":"am17torres","id":70786,"avatar_url":"https://avatars0.githubusercontent.com/u/70786?v=4","gravatar_id":"","url":"https://api.github.com/users/am17torres","html_url":"https://github.com/am17torres","followers_url":"https://api.github.com/users/am17torres/followers","following_url":"https://api.github.com/users/am17torres/following{/other_user}","gists_url":"https://api.github.com/users/am17torres/gists{/gist_id}","starred_url":"https://api.github.com/users/am17torres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/am17torres/subscriptions","organizations_url":"https://api.github.com/users/am17torres/orgs","repos_url":"https://api.github.com/users/am17torres/repos","events_url":"https://api.github.com/users/am17torres/events{/privacy}","received_events_url":"https://api.github.com/users/am17torres/received_events","type":"User","site_admin":false},"labels":[{"id":522425902,"url":"https://api.github.com/repos/typeorm/typeorm/labels/accepting%20PRs","name":"accepting PRs","color":"0e9a96","default":false},{"id":628492179,"url":"https://api.github.com/repos/typeorm/typeorm/labels/community","name":"community","color":"0e8a16","default":false},{"id":333605713,"url":"https://api.github.com/repos/typeorm/typeorm/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":333605714,"url":"https://api.github.com/repos/typeorm/typeorm/labels/help%20wanted","name":"help wanted","color":"159818","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-26T18:39:01Z","updated_at":"2018-02-26T19:03:40Z","closed_at":null,"author_association":"NONE","body":"**Issue type:**\r\n\r\n[x] question\r\n[ ] bug report\r\n[x] feature request\r\n[x] documentation issue\r\n\r\n**Database system/driver:**\r\n\r\n[ ] `cordova`\r\n[ ] `mongodb`\r\n[ ] `mssql`\r\n[ ] `mysql` / `mariadb`\r\n[ ] `oracle`\r\n[ ] `postgres`\r\n[ ] `sqlite`\r\n[ ] `sqljs`\r\n[ ] `websql`\r\n\r\n**TypeORM version:**\r\n\r\n[ ] `latest`\r\n[ ] `@next`\r\n[x] `0.1.13` (or put your version here)\r\n\r\n**Steps to reproduce or a small repository showing the problem:**\r\n\r\nIn general, I store my tests in the same directory as the class itself. E.g.\r\n```\r\nsrc \r\n  entity\r\n    Document.ts\r\n    Document.test.ts\r\n```\r\n\r\n_ormconfig.js_\r\n```js\r\nconst defaults = {\r\n  type: 'postgres',\r\n  host: config.get('db.host'),\r\n  port: config.get('db.port'),\r\n  username: config.get('db.user'),\r\n  password: config.get('db.password'),\r\n  database: 'config.get('db.database')',\r\n  logging: false\r\n};\r\n\r\nfunction getConnectionOptions(environment) {\r\n  var options = {\r\n    local: {\r\n      ...defaults,\r\n      entities: ['src/entity/**/*.ts'],\r\n      migrations: ['db/migration/**/*.ts'],\r\n      logging: true,\r\n      cli: {\r\n        entitiesDir: 'src/entity',\r\n        migrationsDir: 'db/migration'\r\n      }\r\n    },\r\n    test: { ...snip... },\r\n    development: { ...snip... },\r\n    staging: { ...snip... },\r\n    production: { ...snip... },\r\n  };\r\n  return options[environment];\r\n}\r\n\r\nmodule.exports = getConnectionOptions(config.get('env'));\r\n```\r\nThe issue is `entities: ['src/entity/**/*.ts']` also matches `*.test.ts` and then throws `describe is not defined`. \r\n\r\n**Is it possible to specify an exclude pattern?** I tried adding `'!src/entity/**/*.test.ts'` to the list of entities but as I'm sure you guess, it doesn't help. \r\n\r\nAny protips are much appreciated.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/comments/368611802","html_url":"https://github.com/typeorm/typeorm/issues/1654#issuecomment-368611802","issue_url":"https://api.github.com/repos/typeorm/typeorm/issues/1654","id":368611802,"user":{"login":"pleerock","id":1753397,"avatar_url":"https://avatars3.githubusercontent.com/u/1753397?v=4","gravatar_id":"","url":"https://api.github.com/users/pleerock","html_url":"https://github.com/pleerock","followers_url":"https://api.github.com/users/pleerock/followers","following_url":"https://api.github.com/users/pleerock/following{/other_user}","gists_url":"https://api.github.com/users/pleerock/gists{/gist_id}","starred_url":"https://api.github.com/users/pleerock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleerock/subscriptions","organizations_url":"https://api.github.com/users/pleerock/orgs","repos_url":"https://api.github.com/users/pleerock/repos","events_url":"https://api.github.com/users/pleerock/events{/privacy}","received_events_url":"https://api.github.com/users/pleerock/received_events","type":"User","site_admin":false},"created_at":"2018-02-26T19:03:40Z","updated_at":"2018-02-26T19:03:40Z","author_association":"OWNER","body":"take a look where [this function](https://github.com/typeorm/typeorm/blob/master/src/util/DirectoryExportedClassesLoader.ts#L6) is used and probably you'll need to change it."}}
{"actor":{"display_login":"pleerock"}}