{"action":"opened","issue":{"url":"https://api.github.com/repos/aurelia/validation/issues/377","repository_url":"https://api.github.com/repos/aurelia/validation","labels_url":"https://api.github.com/repos/aurelia/validation/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/validation/issues/377/comments","events_url":"https://api.github.com/repos/aurelia/validation/issues/377/events","html_url":"https://github.com/aurelia/validation/issues/377","id":185867209,"number":377,"title":"What is the correct way to initialise the validation plugin during unit tests?","user":{"login":"stevies","id":1218691,"avatar_url":"https://avatars.githubusercontent.com/u/1218691?v=3","gravatar_id":"","url":"https://api.github.com/users/stevies","html_url":"https://github.com/stevies","followers_url":"https://api.github.com/users/stevies/followers","following_url":"https://api.github.com/users/stevies/following{/other_user}","gists_url":"https://api.github.com/users/stevies/gists{/gist_id}","starred_url":"https://api.github.com/users/stevies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevies/subscriptions","organizations_url":"https://api.github.com/users/stevies/orgs","repos_url":"https://api.github.com/users/stevies/repos","events_url":"https://api.github.com/users/stevies/events{/privacy}","received_events_url":"https://api.github.com/users/stevies/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-28T08:32:29Z","updated_at":"2016-10-28T08:32:29Z","closed_at":null,"body":"Question.\r\n\r\nI am using aurelia with webpack.  Current versions of everything.\r\n\r\nWhat is the correct way to initialise the validation plugin during unit tests?\r\n\r\nI have tried something like this - setup.js:\r\n\r\n```\r\nimport 'aurelia-polyfills';\r\nimport {initialize} from 'aurelia-pal-browser';\r\nimport {StageComponent} from 'aurelia-testing';\r\nimport {bootstrap} from 'aurelia-bootstrapper-webpack';\r\n\r\ninitialize();\r\n\r\nlet component;\r\n\r\nbeforeEach(function () {\r\n  component = StageComponent\r\n    .withResources();\r\n  component.bootstrap(aurelia => {\r\n    aurelia.use\r\n      .plugin('aurelia-validation');\r\n  });\r\n});\r\n\r\nafterEach(function () {\r\n\r\n});\r\n```\r\nBut that does not seem to work (maybe I have missed something important). \r\n\r\nWhen I start my tests, I get error:\r\n\r\n```\r\nSTART:\r\n28 10 2016 09:25:26.895:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/\r\n28 10 2016 09:25:26.896:INFO [launcher]: Launching browser Chrome with unlimited concurrency\r\n28 10 2016 09:25:26.931:INFO [launcher]: Starting browser Chrome\r\n28 10 2016 09:25:28.441:INFO [Chromium 53.0.2785 (Ubuntu 0.0.0)]: Connected on socket /#KzQZITDoJTIuxFbZAAAA with id 93068450\r\nChromium 53.0.2785 (Ubuntu 0.0.0) ERROR\r\n  Uncaught Error: Did you forget to add \".plugin('aurelia-validation)\" to your main.js?\r\n  at webpack:///~/aurelia-validation/dist/commonjs/implementation/validation-rules.js:350:0 <- spec-bundle.js:16402\r\nChromium 53.0.2785 (Ubuntu 0.0.0) ERROR\r\n  Uncaught Error: Did you forget to add \".plugin('aurelia-validation)\" to your main.js?\r\n  at webpack:///~/aurelia-validation/dist/commonjs/implementation/validation-rules.js:350:0 <- spec-bundle.js:16402\r\n```\r\n\r\nThis may be related to issues with aurelia-bootstrapper-webpack - there are defects raised there.  \r\n\r\nBut I am wondering if there is any other way to make sure the plugin is initialised.  This is preventing all  unit testing taking place in my app. \r\n"}}
{"actor":{"display_login":"stevies"}}