segmentio/analytics.js-integrations — pull request #258 by lancejpollard (2014-06-27 21:55:06+00:00)
Title: trakio: port test to new api

/cc @ianstormtaylor there are two tests not passing, any ideas? I also had to add `window.trak.push = window.trak.push || function(){}` because of when we're reinitializing in the tests, but not reloading, the real `window.trak` object doesn't have a push method, so it fails.

```
should prefer a name ‣
Error: Expected "stub" to be called with "[
null,
"name"
]",
but it was called with "[
"/",
"name"
]".
at module.exports.exports (http://localhost:4202/build/build.js:260:9)
at Analytics.analytics.called (http://localhost:4202/build/build.js:21464:5)
at Context. (http://localhost:4202/build/build.js:11108:19)
at Test.Runnable.run (http://localhost:4202/test/mocha.js:4212:32)
at Runner.runTest (http://localhost:4202/test/mocha.js:4584:10)
at http://localhost:4202/test/mocha.js:4630:12
at next (http://localhost:4202/test/mocha.js:4510:14)
at http://localhost:4202/test/mocha.js:4519:7
at next (http://localhost:4202/test/mocha.js:4463:23)
at http://localhost:4202/test/mocha.js:4482:7
```

```
should prefer a category and name ‣
Error: Expected "stub" to be called with "[
null,
"category name"
]",
but it was called with "[
"/",
"category name"
]".
at module.exports.exports (http://localhost:4202/build/build.js:260:9)
at Analytics.analytics.called (http://localhost:4202/build/build.js:21464:5)
at Context. (http://localhost:4202/build/build.js:11113:19)
at Test.Runnable.run (http://localhost:4202/test/mocha.js:4212:32)
at Runner.runTest (http://localhost:4202/test/mocha.js:4584:10)
at http://localhost:4202/test/mocha.js:4630:12
at next (http://localhost:4202/test/mocha.js:4510:14)
at http://localhost:4202/test/mocha.js:4519:7
at next (http://localhost:4202/test/mocha.js:4463:23)
at http://localhost:4202/test/mocha.js:4482:7
```