From 026a20f7b467eb3b39c68ed509acc06e5dad58e6 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Mon, 18 Mar 2013 14:54:14 -0700 Subject: [PATCH] chore: rename this shit to Karma BREAKING CHANGE: this breaks in couple of ways - whenever you call the "testacular" binary, change it to "karma", eg. `testacular start` becomes `karma start`. - if you rely on default name of the config file, change it to `karma.conf.js`. - if you access `__testacular__` object in the client code, change it to `__karma__`, eg. `window.__testacular__.files` becomes `window.__karma__.files`. --- .npmignore | 2 +- CHANGELOG.md | 42 ++++++++-------- CONTRIBUTING.md | 18 +++---- Gruntfile.coffee | 4 +- README.md | 48 +++++++++---------- Testacular.sublime-project | 42 ---------------- adapter/angular-scenario.wrapper | 2 +- adapter/jasmine.wrapper | 4 +- adapter/mocha.wrapper | 6 +-- adapter/qunit.wrapper | 4 +- adapter/require.wrapper | 2 +- bin/{testacular => karma} | 2 +- config.template | 2 +- lib/cli.js | 12 ++--- lib/init.js | 2 +- lib/logger.js | 4 +- lib/server.js | 4 +- lib/web-server.js | 2 +- package.json | 16 ++++--- static/client.html | 2 +- static/context.html | 4 +- static/debug.html | 6 +-- static/testacular.src.js | 8 ++-- tasks/lib/changelog.js | 4 +- tasks/test.js | 4 +- test/client/jasmine.spec.js | 2 +- .../{testacular.conf.js => karma.conf.js} | 6 +-- .../{testacular.conf.js => karma.conf.js} | 0 .../{testacular.conf.js => karma.conf.js} | 4 +- .../{testacular.conf.js => karma.conf.js} | 0 .../{testacular.conf.js => karma.conf.js} | 2 +- .../{testacular.conf.js => karma.conf.js} | 2 +- .../{testacular.conf.js => karma.conf.js} | 2 +- test/e2e/coverageRequirejs/main.js | 2 +- .../{testacular.conf.js => karma.conf.js} | 2 +- .../{testacular.conf.js => karma.conf.js} | 4 +- .../{testacular.conf.js => karma.conf.js} | 4 +- .../{testacular.conf.js => karma.conf.js} | 2 +- test/e2e/requirejs/main.js | 4 +- .../{testacular.conf => karma.conf.ignore.js} | 0 ...ar.conf.ignore.js => karma.conf.ignore.js} | 0 test/unit/cli.spec.coffee | 2 +- test/unit/logger.spec.coffee | 20 ++++---- test/unit/web-server.spec.coffee | 2 +- 44 files changed, 132 insertions(+), 174 deletions(-) delete mode 100644 Testacular.sublime-project rename bin/{testacular => karma} (88%) rename test/client/{testacular.conf.js => karma.conf.js} (91%) rename test/e2e/angular-scenario/{testacular.conf.js => karma.conf.js} (100%) rename test/e2e/basic/{testacular.conf.js => karma.conf.js} (71%) rename test/e2e/coffee/{testacular.conf.js => karma.conf.js} (100%) rename test/e2e/coverage/{testacular.conf.js => karma.conf.js} (96%) rename test/e2e/coverageQunit/{testacular.conf.js => karma.conf.js} (96%) rename test/e2e/coverageRequirejs/{testacular.conf.js => karma.conf.js} (94%) rename test/e2e/junit/{testacular.conf.js => karma.conf.js} (90%) rename test/e2e/mocha/{testacular.conf.js => karma.conf.js} (74%) rename test/e2e/qunit/{testacular.conf.js => karma.conf.js} (70%) rename test/e2e/requirejs/{testacular.conf.js => karma.conf.js} (98%) rename test/e2e/syntax-error/{testacular.conf => karma.conf.ignore.js} (100%) rename test/e2e/timeout/{testacular.conf.ignore.js => karma.conf.ignore.js} (100%) diff --git a/.npmignore b/.npmignore index 59495534a..1ebfc4b39 100644 --- a/.npmignore +++ b/.npmignore @@ -13,7 +13,7 @@ jsl.conf Gruntfile.coffee changelog.sh -Testacular.sublime-* +Karma.sublime-* screencast* adapter/jasmine.src.js diff --git a/CHANGELOG.md b/CHANGELOG.md index bc494a6b4..13d201151 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ #### Bug Fixes -* **config:** do not change urlRoot even if proxied ([1be1ae1d](https://github.com/testacular/testacular/commit/1be1ae1dc7ff7314f4ac2854815cb39d31362f14)) -* **coverage:** always send a result object ([2d210aa6](https://github.com/testacular/testacular/commit/2d210aa6697991f2eba05de58a696c5210485c88), closes [#365](https://github.com/testacular/testacular/issues/365)) -* **reporter.teamcity:** report spec names and proper browser name ([c8f6f5ea](https://github.com/testacular/testacular/commit/c8f6f5ea0c5c40d37b511d51b49bd22c9da5ea86)) +* **config:** do not change urlRoot even if proxied ([1be1ae1d](https://github.com/karma-runner/karma/commit/1be1ae1dc7ff7314f4ac2854815cb39d31362f14)) +* **coverage:** always send a result object ([2d210aa6](https://github.com/karma-runner/karma/commit/2d210aa6697991f2eba05de58a696c5210485c88), closes [#365](https://github.com/karma-runner/karma/issues/365)) +* **reporter.teamcity:** report spec names and proper browser name ([c8f6f5ea](https://github.com/karma-runner/karma/commit/c8f6f5ea0c5c40d37b511d51b49bd22c9da5ea86)) ## v0.6.0 (2013-02-22) @@ -17,16 +17,16 @@ #### Bug Fixes -* **adapter.requirejs:** do not configure baseUrl automatically ([63f3f409](https://github.com/testacular/testacular/commit/63f3f409ae85a5137396a7ed6537bedfe4437cb3), closes [#291](https://github.com/testacular/testacular/issues/291)) -* **init:** add missing browsers (Opera, IE) ([f39e5645](https://github.com/testacular/testacular/commit/f39e5645ec561c2681d907f7c1611f01911ee8fd)) -* **reporter.junit:** Add browser log output to JUnit.xml ([f108799a](https://github.com/testacular/testacular/commit/f108799a4d8fd95b8c0250ee83c23ada25d026b9), closes [#302](https://github.com/testacular/testacular/issues/302)) +* **adapter.requirejs:** do not configure baseUrl automatically ([63f3f409](https://github.com/karma-runner/karma/commit/63f3f409ae85a5137396a7ed6537bedfe4437cb3), closes [#291](https://github.com/karma-runner/karma/issues/291)) +* **init:** add missing browsers (Opera, IE) ([f39e5645](https://github.com/karma-runner/karma/commit/f39e5645ec561c2681d907f7c1611f01911ee8fd)) +* **reporter.junit:** Add browser log output to JUnit.xml ([f108799a](https://github.com/karma-runner/karma/commit/f108799a4d8fd95b8c0250ee83c23ada25d026b9), closes [#302](https://github.com/karma-runner/karma/issues/302)) #### Features -* add Teamcity reporter ([03e700ae](https://github.com/testacular/testacular/commit/03e700ae2234ca7ddb8f9235343e3b0c80868bbd)) -* **adapter.jasmine:** remove only last failed specs anti-feature ([435bf72c](https://github.com/testacular/testacular/commit/435bf72cb12112462940c8114fbaa19f9de38531), closes [#148](https://github.com/testacular/testacular/issues/148)) -* **config:** allow empty config file when called programmatically ([f3d77424](https://github.com/testacular/testacular/commit/f3d77424009f621e1fb9d60eeec7f052ebb3c585), closes [#358](https://github.com/testacular/testacular/issues/358)) +* add Teamcity reporter ([03e700ae](https://github.com/karma-runner/karma/commit/03e700ae2234ca7ddb8f9235343e3b0c80868bbd)) +* **adapter.jasmine:** remove only last failed specs anti-feature ([435bf72c](https://github.com/karma-runner/karma/commit/435bf72cb12112462940c8114fbaa19f9de38531), closes [#148](https://github.com/karma-runner/karma/issues/148)) +* **config:** allow empty config file when called programmatically ([f3d77424](https://github.com/karma-runner/karma/commit/f3d77424009f621e1fb9d60eeec7f052ebb3c585), closes [#358](https://github.com/karma-runner/karma/issues/358)) ### v0.5.10 (2013-02-14) @@ -34,15 +34,15 @@ #### Bug Fixes -* **init:** fix the logger configuration ([481dc3fd](https://github.com/testacular/testacular/commit/481dc3fd75f45a0efa8aabdb1c71e8234b9e8a06), closes [#340](https://github.com/testacular/testacular/issues/340)) -* **proxy:** fix crashing proxy when browser hangs connection ([1c78a01a](https://github.com/testacular/testacular/commit/1c78a01a19411accb86f0bde9e040e5088752575)) +* **init:** fix the logger configuration ([481dc3fd](https://github.com/karma-runner/karma/commit/481dc3fd75f45a0efa8aabdb1c71e8234b9e8a06), closes [#340](https://github.com/karma-runner/karma/issues/340)) +* **proxy:** fix crashing proxy when browser hangs connection ([1c78a01a](https://github.com/karma-runner/karma/commit/1c78a01a19411accb86f0bde9e040e5088752575)) #### Features -* set urlRoot to /__testacular__/ when proxying the root ([8b4fd64d](https://github.com/testacular/testacular/commit/8b4fd64df6b7d07b5479e43dcd8cd2aa5e1efc9c)) -* **adapter.requirejs:** normalize paths before appending timestamp ([94889e7d](https://github.com/testacular/testacular/commit/94889e7d2de701c67a2612e3fc6a51bfae891d36)) -* update dependencies to the latest ([93f96278](https://github.com/testacular/testacular/commit/93f9627817f2d5d9446de9935930ca85cfa7df7f), [e34d8834](https://github.com/testacular/testacular/commit/e34d8834d69ec4e022fcd6e1be4055add96d693c)) +* set urlRoot to /__karma__/ when proxying the root ([8b4fd64d](https://github.com/karma-runner/karma/commit/8b4fd64df6b7d07b5479e43dcd8cd2aa5e1efc9c)) +* **adapter.requirejs:** normalize paths before appending timestamp ([94889e7d](https://github.com/karma-runner/karma/commit/94889e7d2de701c67a2612e3fc6a51bfae891d36)) +* update dependencies to the latest ([93f96278](https://github.com/karma-runner/karma/commit/93f9627817f2d5d9446de9935930ca85cfa7df7f), [e34d8834](https://github.com/karma-runner/karma/commit/e34d8834d69ec4e022fcd6e1be4055add96d693c)) @@ -51,16 +51,16 @@ #### Bug Fixes -* **adapter.requirejs:** show error if no timestamp defined for a file ([59dbdbd1](https://github.com/testacular/testacular/commit/59dbdbd136baa87467b9b9a4cb6ce226ae87bbef)) -* **init:** fix logger configuration ([557922d7](https://github.com/testacular/testacular/commit/557922d71941e0929f9cdc0d3794424a1f27b311)) -* **reporter:** remove newline from base reporter browser dump ([dfae18b6](https://github.com/testacular/testacular/commit/dfae18b63b413a1e6240d00b9dc0521ac0386ec5), closes [#297](https://github.com/testacular/testacular/issues/297)) -* **reporter.dots:** only add newline to message when needed ([dbe1155c](https://github.com/testacular/testacular/commit/dbe1155cb57fc4caa792f83f45288238db0fc7e0) +* **adapter.requirejs:** show error if no timestamp defined for a file ([59dbdbd1](https://github.com/karma-runner/karma/commit/59dbdbd136baa87467b9b9a4cb6ce226ae87bbef)) +* **init:** fix logger configuration ([557922d7](https://github.com/karma-runner/karma/commit/557922d71941e0929f9cdc0d3794424a1f27b311)) +* **reporter:** remove newline from base reporter browser dump ([dfae18b6](https://github.com/karma-runner/karma/commit/dfae18b63b413a1e6240d00b9dc0521ac0386ec5), closes [#297](https://github.com/karma-runner/karma/issues/297)) +* **reporter.dots:** only add newline to message when needed ([dbe1155c](https://github.com/karma-runner/karma/commit/dbe1155cb57fc4caa792f83f45288238db0fc7e0) #### Features -* add "debug" button to easily open debugging window ([da85aab9](https://github.com/testacular/testacular/commit/da85aab927edd1614e4e05b136dee834344aa3cb)) -* **config:** support running on a custom hostname ([b8c5fe85](https://github.com/testacular/testacular/commit/b8c5fe8533b13fd59cbf48972d2021069a84ae5b)) -* **reporter.junit:** add a 'skipped' tag for skipped testcases ([6286406e](https://github.com/testacular/testacular/commit/6286406e0a36a61125ea16d6f49be07030164cb0), closes [#321](https://github.com/testacular/testacular/issues/321)) +* add "debug" button to easily open debugging window ([da85aab9](https://github.com/karma-runner/karma/commit/da85aab927edd1614e4e05b136dee834344aa3cb)) +* **config:** support running on a custom hostname ([b8c5fe85](https://github.com/karma-runner/karma/commit/b8c5fe8533b13fd59cbf48972d2021069a84ae5b)) +* **reporter.junit:** add a 'skipped' tag for skipped testcases ([6286406e](https://github.com/karma-runner/karma/commit/6286406e0a36a61125ea16d6f49be07030164cb0), closes [#321](https://github.com/karma-runner/karma/issues/321)) ### v0.5.8 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0f5cad3d..6f9c864f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,11 @@ # How to contribute -If you are thinking about making Testacular better, or you just want to hack on it, that’s great! Here +If you are thinking about making Karma better, or you just want to hack on it, that’s great! Here are some tips to get you started. ## Getting Started * Make sure you have a [GitHub account](https://github.com/signup/free) -* Consider [submiting a ticket](https://github.com/vojtajina/testacular/issues/new) for your issue, +* Consider [submiting a ticket](https://github.com/karma-runner/karma/issues/new) for your issue, assuming one does not already exist. * Clearly describe the issue including steps to reproduce when it is a bug. * Make sure you fill in the earliest version that you know has the issue. @@ -14,11 +14,11 @@ are some tips to get you started. * Fork the repository on GitHub ## Initial setup -* Clone your fork. For these instructions, we assume you cloned into '~/github/testacular'. +* Clone your fork. For these instructions, we assume you cloned into '~/github/karma'. * Install dependencies: ```bash - $ cd ~/github/testacular + $ cd ~/github/karma # install local dependencies $ npm install @@ -29,7 +29,7 @@ are some tips to get you started. * Ensure you have a stable working baseline for development. ```bash # This will run a full build and test pass. - $ cd ~/github/testacular + $ cd ~/github/karma $ grunt ``` On an unmodified 'master' branch, this command should always complete and report success. @@ -40,7 +40,7 @@ are some tips to get you started. * File an issue (see above) * Run 'grunt init-dev-env'. This will install a git commit trigger that will ensure your commit messages - follows the [Testacular - Git Commit Msg Format Conventions] + follows the [Karma - Git Commit Msg Format Conventions] (https://docs.google.com/document/d/1JCFlkQ59Bx4qN1WKS1dtKXKl5G_lED6Lxey3iPNpQOs/pub). @@ -58,7 +58,7 @@ are some tips to get you started. * Add tests for your changes as (or before) you make them, if at all possible. We use coffee script for our tests. * Commit your changes - * Follow the [Testacular - Git Commit Msg Format Conventions] + * Follow the [Karma - Git Commit Msg Format Conventions] (https://docs.google.com/document/d/1JCFlkQ59Bx4qN1WKS1dtKXKl5G_lED6Lxey3iPNpQOs/pub). * Push your changes to your forked repository * Send a pull request to the `master` branch. @@ -92,8 +92,8 @@ $ grunt test:client # Additional Resources -* [Issue tracker](https://github.com/vojtajina/testacular/issues) -* [Mailing List](https://groups.google.com/forum/#!forum/testacular) +* [Issue tracker](https://github.com/karma-runner/karma/issues) +* [Mailing List](https://groups.google.com/forum/#!forum/karma-users) * [General GitHub documentation](http://help.github.com/) * [GitHub pull request documentation](http://help.github.com/send-pull-requests/) * [@TestacularJS](http://twitter.com/TestacularJS) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index e3ece5e66..37f9176b8 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -38,8 +38,8 @@ module.exports = (grunt) -> test: unit: 'simplemocha:unit' tasks: 'simplemocha:tasks' - client: 'test/client/testacular.conf.js' - e2e: 'test/e2e/*/testacular.conf.js' + client: 'test/client/karma.conf.js' + e2e: 'test/e2e/*/karma.conf.js' simplemocha: diff --git a/README.md b/README.md index 9109b628e..77abee999 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# Testacular [![Build Status](https://secure.travis-ci.org/testacular/testacular.png?branch=stable)](http://travis-ci.org/testacular/testacular) [![Build Status](https://secure.travis-ci.org/testacular/testacular.png?branch=master)](http://travis-ci.org/testacular/testacular) +# Karma [![Build Status](https://secure.travis-ci.org/karma-runner/karma.png?branch=stable)](http://travis-ci.org/karma-runner/karma) [![Build Status](https://secure.travis-ci.org/karma-runner/karma.png?branch=master)](http://travis-ci.org/karma-runner/karma) A simple tool that allows you to execute JavaScript code in multiple _real_ browsers, powered by [Node.js] and [Socket.io]. -> The main purpose of Testacular is to make your TDD development easy, +> The main purpose of Karma is to make your TDD development easy, > fast, and fun. -## When should I use Testacular? +## When should I use Karma? * You want to test code in *real* browsers. * You want to test code in multiple browsers (desktop, mobile, @@ -24,7 +24,7 @@ _real_ browsers, powered by [Node.js] and [Socket.io]. ## But I still want to use \_insert testing library\_ -Testacular is not a testing framework, neither an assertion library, +Karma is not a testing framework, neither an assertion library, so for that you can use pretty much anything you like. Right now out of the box there is support for @@ -56,14 +56,14 @@ Every serious project has a screencast, so here is ours. Just click If you have [Node.js] installed, it's as simple as ```bash -$ npm install -g testacular +$ npm install -g karma ``` This will give you the latest stable version available on npm. If you want to live life on the edge you can do so by ```bash -$ npm install -g testacular@canary +$ npm install -g karma@canary ``` The curious can have a look at the [wiki] articles for @@ -72,36 +72,36 @@ The curious can have a look at the [wiki] articles for ### Using it. Go into your project and create a testacular configuration. That is -just a simple JavaScript or CoffeeScript file that tells Testacular +just a simple JavaScript or CoffeeScript file that tells Karma where all the awesomeness of your project are. You can find a simple example in -[test/client/testacular.conf.js](https://github.com/testacular/testacular/blob/master/test/client/testacular.conf.js) +[test/client/karma.conf.js](https://github.com/karma-runner/karma/blob/master/test/client/karma.conf.js) which contains most of the options. To create your own from scratch there is the `init` command, which -will be named `testacular.conf.js` by default: +will be named `karma.conf.js` by default: ```bash -$ testacular init +$ karma init ``` This will ask you many questions and if you answered them all correct -you will be allowed to use Testacular. +you will be allowed to use Karma. For more information on the configuration options see [Configuration File Overview]. Now that you have your configuration all that is left to do is to -start Testacular: +start Karma: ```bash -$ testacular start +$ karma start ``` If you want to run tests manually (without auto watching file changes), you can: ```bash -$ testacular run +$ karma run ``` -But only if you have started the Testacular server before. +But only if you have started the Karma server before. ## Why did you create this? @@ -124,7 +124,7 @@ use the awesome [Socket.io] library and [Node.js]. ## This is so great. I want to help. See -[Contributing.md](https://github.com/vojtajina/testacular/blob/master/CONTRIBUTING.md) +[Contributing.md](https://github.com/karma-runner/karma/blob/master/CONTRIBUTING.md) or the [wiki] for more information. @@ -166,15 +166,15 @@ or the [wiki] for more information. [Semantic Versioning]: http://semver.org/ [here]: http://www.youtube.com/watch?v=MVw8N3hTfCI [installers]: http://nodejs.org/download/ -[wiki]: https://github.com/testacular/testacular/wiki -[Wiki]: https://github.com/testacular/testacular/wiki -[Getting Started]: https://github.com/testacular/testacular/wiki/Getting-Started -[Versioning]: https://github.com/testacular/testacular/wiki/Versioning -[Configuration File Overview]: https://github.com/testacular/testacular/wiki/Configuration-File-Overview -[Mailing List]: https://groups.google.com/forum/#!forum/testacular -[Issuetracker]: https://github.com/testacular/testacular/issues +[wiki]: https://github.com/karma-runner/karma/wiki +[Wiki]: https://github.com/karma-runner/karma/wiki +[Getting Started]: https://github.com/karma-runner/karma/wiki/Getting-Started +[Versioning]: https://github.com/karma-runner/karma/wiki/Versioning +[Configuration File Overview]: https://github.com/karma-runner/karma/wiki/Configuration-File-Overview +[Mailing List]: https://groups.google.com/forum/#!forum/karma-users +[Issuetracker]: https://github.com/karma-runner/karma/issues [@TestacularJS]: http://twitter.com/TestacularJS -[Browsers]: https://github.com/testacular/testacular/wiki/Browsers +[Browsers]: https://github.com/karma-runner/karma/wiki/Browsers [RequireJS]: http://requirejs.org/ [Istanbul]: https://github.com/gotwarlost/istanbul diff --git a/Testacular.sublime-project b/Testacular.sublime-project deleted file mode 100644 index 890a0b49e..000000000 --- a/Testacular.sublime-project +++ /dev/null @@ -1,42 +0,0 @@ -{ - "build_systems": - [ - { - "name": "Unit tests", - "cmd": ["grunt", "simplemocha:unit", "--no-color"], - "working_dir": "${project_path}", - "path": "/usr/local/nvm/v0.8.4/bin" - }, - { - "name": "Task tests", - "cmd": ["grunt", "simplemocha:tasks", "--no-color"], - "working_dir": "${project_path}", - "path": "/usr/local/nvm/v0.8.4/bin" - }, - { - "name": "Client tests", - "cmd": ["grunt", "test:client", "--no-color"], - "working_dir": "${project_path}", - "path": "/usr/local/nvm/v0.8.4/bin" - } - ], - "folders": - [ - { - "path": ".", - "folder_exclude_patterns": ["node_modules"], - "file_exclude_patterns": [] - - } - ], - "settings": - { - "tab_size": 2, - "open_related_patterns": [ - ["*/lib/*.js", "*/test/unit/*.spec.coffee"], - ["*/adapter/*.src.js", "*/test/client/*.spec.js"], - ["*/static/*.src.js", "*/test/client/*.spec.js"] - ], - "build_switcher_systems": ["Unit tests", "Task tests", "Client tests"] - } -} diff --git a/adapter/angular-scenario.wrapper b/adapter/angular-scenario.wrapper index f4997c85d..2a324d8fd 100644 --- a/adapter/angular-scenario.wrapper +++ b/adapter/angular-scenario.wrapper @@ -2,6 +2,6 @@ %CONTENT% -window.__testacular__.start = createNgScenarioStartFn(window.__testacular__, angular.scenario.setUpAndRun); +window.__karma__.start = createNgScenarioStartFn(window.__karma__, angular.scenario.setUpAndRun); })(window); diff --git a/adapter/jasmine.wrapper b/adapter/jasmine.wrapper index dce54f665..3fd761d37 100644 --- a/adapter/jasmine.wrapper +++ b/adapter/jasmine.wrapper @@ -3,8 +3,8 @@ %CONTENT% -window.__testacular__.start = createStartFn(window.__testacular__); -window.dump = createDumpFn(window.__testacular__, function(value) { +window.__karma__.start = createStartFn(window.__karma__); +window.dump = createDumpFn(window.__karma__, function(value) { return window.angular && window.angular.mock && window.angular.mock.dump(value) || value; }); diff --git a/adapter/mocha.wrapper b/adapter/mocha.wrapper index 31116d08c..b7fd7f335 100644 --- a/adapter/mocha.wrapper +++ b/adapter/mocha.wrapper @@ -3,10 +3,10 @@ %CONTENT% -window.__testacular__.start = createMochaStartFn(window.mocha); -window.dump = createDumpFn(window.__testacular__, function(value) { +window.__karma__.start = createMochaStartFn(window.mocha); +window.dump = createDumpFn(window.__karma__, function(value) { return window.angular && window.angular.mock && window.angular.mock.dump(value) || value; }); -window.mocha.setup({reporter: createMochaReporterConstructor(window.__testacular__), ui: 'bdd', +window.mocha.setup({reporter: createMochaReporterConstructor(window.__karma__), ui: 'bdd', globals: ['__cov*']}); })(window); diff --git a/adapter/qunit.wrapper b/adapter/qunit.wrapper index 084934c41..899b585fe 100644 --- a/adapter/qunit.wrapper +++ b/adapter/qunit.wrapper @@ -3,8 +3,8 @@ %CONTENT% -window.__testacular__.start = createQUnitStartFn(window.__testacular__); -window.dump = createDumpFn(window.__testacular__, function (value) { +window.__karma__.start = createQUnitStartFn(window.__karma__); +window.dump = createDumpFn(window.__karma__, function (value) { return window.angular && window.angular.mock && window.angular.mock.dump(value) || value; }); })(window); diff --git a/adapter/require.wrapper b/adapter/require.wrapper index 89999cc1f..121e29b28 100644 --- a/adapter/require.wrapper +++ b/adapter/require.wrapper @@ -8,4 +8,4 @@ testacular.loaded = function() {}; // patch require.js requirejs.load = createPatchedLoad(testacular.files, requirejs.load); -})(window.__testacular__, window.requirejs, window.require); +})(window.__karma__, window.requirejs, window.require); diff --git a/bin/testacular b/bin/karma similarity index 88% rename from bin/testacular rename to bin/karma index d0320df93..67ac9d6ce 100755 --- a/bin/testacular +++ b/bin/karma @@ -4,7 +4,7 @@ var path = require('path'); var fs = require('fs'); // Try to find a local install -var dir = path.resolve(process.cwd(), 'node_modules', 'testacular', 'lib'); +var dir = path.resolve(process.cwd(), 'node_modules', 'karma', 'lib'); // Check if the local install exists else we use the install we are in if (!fs.existsSync(dir)) { diff --git a/config.template b/config.template index d929fe847..cc618d2fc 100644 --- a/config.template +++ b/config.template @@ -1,4 +1,4 @@ -// Testacular configuration +// Karma configuration // Generated on %DATE% diff --git a/lib/cli.js b/lib/cli.js index 8648315c1..0a09824b7 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -12,7 +12,7 @@ var processArgs = function(argv, options) { } if (argv.version) { - console.log('Testacular version: ' + constant.VERSION); + console.log('Karma version: ' + constant.VERSION); process.exit(0); } @@ -51,7 +51,7 @@ var processArgs = function(argv, options) { options.reporters = options.reporters.split(','); } - options.configFile = path.resolve(argv._.shift() || 'testacular.conf.js'); + options.configFile = path.resolve(argv._.shift() || 'karma.conf.js'); return options; }; @@ -59,7 +59,7 @@ var processArgs = function(argv, options) { var describeShared = function() { optimist - .usage('Testacular - Spectacular Test Runner for JavaScript.\n\n' + + .usage('Karma - Spectacular Test Runner for JavaScript.\n\n' + 'Usage:\n' + ' $0 \n\n' + 'Commands:\n' + @@ -74,7 +74,7 @@ var describeShared = function() { var describeInit = function() { optimist - .usage('Testacular - Spectacular Test Runner for JavaScript.\n\n' + + .usage('Karma - Spectacular Test Runner for JavaScript.\n\n' + 'INIT - Initialize a config file.\n\n' + 'Usage:\n' + ' $0 init []') @@ -88,7 +88,7 @@ var describeInit = function() { var describeStart = function() { optimist - .usage('Testacular - Spectacular Test Runner for JavaScript.\n\n' + + .usage('Karma - Spectacular Test Runner for JavaScript.\n\n' + 'START - Start the server / do a single run.\n\n' + 'Usage:\n' + ' $0 start [] []') @@ -112,7 +112,7 @@ var describeStart = function() { var describeRun = function() { optimist - .usage('Testacular - Spectacular Test Runner for JavaScript.\n\n' + + .usage('Karma - Spectacular Test Runner for JavaScript.\n\n' + 'RUN - Run the tests (requires running server).\n\n' + 'Usage:\n' + ' $0 run []') diff --git a/lib/init.js b/lib/init.js index 27e2c63d1..bcc9e1b3d 100755 --- a/lib/init.js +++ b/lib/init.js @@ -82,7 +82,7 @@ var questions = [{ }, { id: 'includedFiles', question: 'Which files do you want to include with diff --git a/static/debug.html b/static/debug.html index 9fe1fa11f..e9198c8f0 100644 --- a/static/debug.html +++ b/static/debug.html @@ -6,7 +6,7 @@ --> - Testacular DEBUG RUNNER + Karma DEBUG RUNNER @@ -17,7 +17,7 @@ into it. If it is before body, then it fails to find the body and crashes and burns in an epic manner. --> diff --git a/static/testacular.src.js b/static/testacular.src.js index 8afa49f9a..90c3829c4 100644 --- a/static/testacular.src.js +++ b/static/testacular.src.js @@ -27,7 +27,7 @@ var titleElement = document.getElementById('title'); var bannerElement = document.getElementById('banner'); var updateStatus = function(status) { return function(param) { - titleElement.innerHTML = 'Testacular - ' + (param ? status.replace('$', param) : status); + titleElement.innerHTML = 'Karma - ' + (param ? status.replace('$', param) : status); bannerElement.className = status === 'connected' ? 'online' : 'offline'; }; }; @@ -54,11 +54,11 @@ var Testacular = function(socket, context, navigator, location) { }; }; - contextWindow.__testacular__ = this; + contextWindow.__karma__ = this; // This causes memory leak in Chrome (17.0.963.66) contextWindow.onerror = function() { - return contextWindow.__testacular__.error.apply(contextWindow.__testacular__, arguments); + return contextWindow.__karma__.error.apply(contextWindow.__karma__, arguments); }; // patch the console @@ -66,7 +66,7 @@ var Testacular = function(socket, context, navigator, location) { var browserConsoleLog = localConsole.log; localConsole.log = function() { - contextWindow.__testacular__.info({dump: Array.prototype.slice.call(arguments, 0)}); + contextWindow.__karma__.info({dump: Array.prototype.slice.call(arguments, 0)}); return browserConsoleLog.apply(localConsole, arguments); }; }; diff --git a/tasks/lib/changelog.js b/tasks/lib/changelog.js index 504ef11dc..676ea68a2 100755 --- a/tasks/lib/changelog.js +++ b/tasks/lib/changelog.js @@ -13,8 +13,8 @@ var GIT_TAG_CMD = 'git describe --tags --abbrev=0'; var PATCH_HEADER_TPL = '\n### %s (%s)\n\n'; var MINOR_HEADER_TPL = '\n## %s (%s)\n\n'; -var LINK_ISSUE = '[#%s](https://github.com/testacular/testacular/issues/%s)'; -var LINK_COMMIT = '[%s](https://github.com/testacular/testacular/commit/%s)'; +var LINK_ISSUE = '[#%s](https://github.com/karma-runner/karma/issues/%s)'; +var LINK_COMMIT = '[%s](https://github.com/karma-runner/karma/commit/%s)'; var EMPTY_COMPONENT = '$$'; var MAX_SUBJECT_LENGTH = 80; diff --git a/tasks/test.js b/tasks/test.js index f50a24d4d..65d4fdc74 100644 --- a/tasks/test.js +++ b/tasks/test.js @@ -14,7 +14,7 @@ module.exports = function(grunt) { var specDone = this.async(); var node = require('which').sync('node'); var path = require('path'); - var cmd = path.join(__dirname, '..', 'bin', 'testacular'); + var cmd = path.join(__dirname, '..', 'bin', 'karma'); var spawnTestacular = function(args, callback) { grunt.log.writeln(['Running', cmd].concat(args).join(' ')); @@ -59,7 +59,7 @@ module.exports = function(grunt) { } else { args[1] = tests.shift(); if (args[1]) { - if (args[1] === 'test/e2e/angular-scenario/testacular.conf.js') { + if (args[1] === 'test/e2e/angular-scenario/karma.conf.js') { processToKill = grunt.util.spawn({ cmd: node, args: ['test/e2e/angular-scenario/server.js'] }, function() {}); diff --git a/test/client/jasmine.spec.js b/test/client/jasmine.spec.js index 057f214b0..524103dbd 100644 --- a/test/client/jasmine.spec.js +++ b/test/client/jasmine.spec.js @@ -149,7 +149,7 @@ describe('jasmine adapter', function() { var dump, testacular; beforeEach(function() { - testacular = jasmine.createSpyObj('__testacular__', ['info']); + testacular = jasmine.createSpyObj('__karma__', ['info']); }); diff --git a/test/client/testacular.conf.js b/test/client/karma.conf.js similarity index 91% rename from test/client/testacular.conf.js rename to test/client/karma.conf.js index 7204eb3e8..342c23c14 100644 --- a/test/client/testacular.conf.js +++ b/test/client/karma.conf.js @@ -1,9 +1,9 @@ // Sample Testacular configuration file, that contain pretty much all the available options -// It's used for running client tests on Travis (http://travis-ci.org/#!/vojtajina/testacular) -// Most of the options can be overriden by cli arguments (see testacular --help) +// It's used for running client tests on Travis (http://travis-ci.org/#!/karma-runner/karma) +// Most of the options can be overriden by cli arguments (see karma --help) // // For all available config options and default values, see: -// https://github.com/vojtajina/testacular/blob/stable/lib/config.js#L54 +// https://github.com/karma-runner/karma/blob/stable/lib/config.js#L54 // base path, that will be used to resolve files and exclude diff --git a/test/e2e/angular-scenario/testacular.conf.js b/test/e2e/angular-scenario/karma.conf.js similarity index 100% rename from test/e2e/angular-scenario/testacular.conf.js rename to test/e2e/angular-scenario/karma.conf.js diff --git a/test/e2e/basic/testacular.conf.js b/test/e2e/basic/karma.conf.js similarity index 71% rename from test/e2e/basic/testacular.conf.js rename to test/e2e/basic/karma.conf.js index af4a0e743..f3ac992e0 100644 --- a/test/e2e/basic/testacular.conf.js +++ b/test/e2e/basic/karma.conf.js @@ -5,11 +5,11 @@ files = [ ]; exclude = [ - 'testacular.conf.js' + 'karma.conf.js' ]; autoWatch = true; browsers = ['Chrome'] -reporters = ['dots']; \ No newline at end of file +reporters = ['dots']; diff --git a/test/e2e/coffee/testacular.conf.js b/test/e2e/coffee/karma.conf.js similarity index 100% rename from test/e2e/coffee/testacular.conf.js rename to test/e2e/coffee/karma.conf.js diff --git a/test/e2e/coverage/testacular.conf.js b/test/e2e/coverage/karma.conf.js similarity index 96% rename from test/e2e/coverage/testacular.conf.js rename to test/e2e/coverage/karma.conf.js index fea3cce6d..4ab2c1cf0 100644 --- a/test/e2e/coverage/testacular.conf.js +++ b/test/e2e/coverage/karma.conf.js @@ -6,7 +6,7 @@ files = [ ]; exclude = [ - 'testacular.conf.js' + 'karma.conf.js' ]; autoWatch = true; diff --git a/test/e2e/coverageQunit/testacular.conf.js b/test/e2e/coverageQunit/karma.conf.js similarity index 96% rename from test/e2e/coverageQunit/testacular.conf.js rename to test/e2e/coverageQunit/karma.conf.js index 219f4aa72..1082ec5bc 100644 --- a/test/e2e/coverageQunit/testacular.conf.js +++ b/test/e2e/coverageQunit/karma.conf.js @@ -6,7 +6,7 @@ files = [ ]; exclude = [ - 'testacular.conf.js' + 'karma.conf.js' ]; autoWatch = true; diff --git a/test/e2e/coverageRequirejs/testacular.conf.js b/test/e2e/coverageRequirejs/karma.conf.js similarity index 94% rename from test/e2e/coverageRequirejs/testacular.conf.js rename to test/e2e/coverageRequirejs/karma.conf.js index dec2e6398..792582340 100644 --- a/test/e2e/coverageRequirejs/testacular.conf.js +++ b/test/e2e/coverageRequirejs/karma.conf.js @@ -9,7 +9,7 @@ files = [ ]; exclude = [ - 'testacular.conf.js' + 'karma.conf.js' ]; autoWatch = true; diff --git a/test/e2e/coverageRequirejs/main.js b/test/e2e/coverageRequirejs/main.js index 9f1ed6d5b..57a60f408 100644 --- a/test/e2e/coverageRequirejs/main.js +++ b/test/e2e/coverageRequirejs/main.js @@ -6,5 +6,5 @@ require.config({ deps: ['test'], // we have to kick of jasmine, as it is asynchronous - callback: window.__testacular__.start + callback: window.__karma__.start }); diff --git a/test/e2e/junit/testacular.conf.js b/test/e2e/junit/karma.conf.js similarity index 90% rename from test/e2e/junit/testacular.conf.js rename to test/e2e/junit/karma.conf.js index fedb2d0fd..d0f06b2be 100644 --- a/test/e2e/junit/testacular.conf.js +++ b/test/e2e/junit/karma.conf.js @@ -5,7 +5,7 @@ files = [ ]; exclude = [ - 'testacular.conf.js' + 'karma.conf.js' ]; autoWatch = true; diff --git a/test/e2e/mocha/testacular.conf.js b/test/e2e/mocha/karma.conf.js similarity index 74% rename from test/e2e/mocha/testacular.conf.js rename to test/e2e/mocha/karma.conf.js index 312d012d3..5fbb304b7 100644 --- a/test/e2e/mocha/testacular.conf.js +++ b/test/e2e/mocha/karma.conf.js @@ -5,11 +5,11 @@ files = [ ]; exclude = [ - 'testacular.conf.js' + 'karma.conf.js' ]; autoWatch = true; browsers = ['Chrome']; singleRun = false; -reporters = ['dots']; \ No newline at end of file +reporters = ['dots']; diff --git a/test/e2e/qunit/testacular.conf.js b/test/e2e/qunit/karma.conf.js similarity index 70% rename from test/e2e/qunit/testacular.conf.js rename to test/e2e/qunit/karma.conf.js index a24eed121..5cfc07af2 100644 --- a/test/e2e/qunit/testacular.conf.js +++ b/test/e2e/qunit/karma.conf.js @@ -5,11 +5,11 @@ files = [ ]; exclude = [ - 'testacular.conf.js' + 'karma.conf.js' ]; autoWatch = true; browsers = ['Chrome'] -reporters = ['dots']; \ No newline at end of file +reporters = ['dots']; diff --git a/test/e2e/requirejs/testacular.conf.js b/test/e2e/requirejs/karma.conf.js similarity index 98% rename from test/e2e/requirejs/testacular.conf.js rename to test/e2e/requirejs/karma.conf.js index bbc920953..4ab0ffeef 100644 --- a/test/e2e/requirejs/testacular.conf.js +++ b/test/e2e/requirejs/karma.conf.js @@ -22,7 +22,7 @@ files = [ // list of files to exclude exclude = [ - 'testacular.conf.js' + 'karma.conf.js' ]; diff --git a/test/e2e/requirejs/main.js b/test/e2e/requirejs/main.js index 74a11acb5..d9d01807b 100644 --- a/test/e2e/requirejs/main.js +++ b/test/e2e/requirejs/main.js @@ -1,7 +1,7 @@ var allTestFiles = []; var TEST_REGEXP = /test/; -Object.keys(window.__testacular__.files).forEach(function(file) { +Object.keys(window.__karma__.files).forEach(function(file) { if (TEST_REGEXP.test(file)) { allTestFiles.push(file); } @@ -22,5 +22,5 @@ require.config({ deps: allTestFiles, // we have to kick of jasmine, as it is asynchronous - callback: window.__testacular__.start + callback: window.__karma__.start }); diff --git a/test/e2e/syntax-error/testacular.conf b/test/e2e/syntax-error/karma.conf.ignore.js similarity index 100% rename from test/e2e/syntax-error/testacular.conf rename to test/e2e/syntax-error/karma.conf.ignore.js diff --git a/test/e2e/timeout/testacular.conf.ignore.js b/test/e2e/timeout/karma.conf.ignore.js similarity index 100% rename from test/e2e/timeout/testacular.conf.ignore.js rename to test/e2e/timeout/karma.conf.ignore.js diff --git a/test/unit/cli.spec.coffee b/test/unit/cli.spec.coffee index 5eefa632d..638497ed7 100644 --- a/test/unit/cli.spec.coffee +++ b/test/unit/cli.spec.coffee @@ -26,7 +26,7 @@ describe 'cli', -> it 'should parse options without configFile and set default', -> options = processArgs ['--auto-watch', '--auto-watch-interval', '10'] - expect(options.configFile).to.equal path.join(CWD, 'testacular.conf.js') + expect(options.configFile).to.equal path.join(CWD, 'karma.conf.js') expect(options.autoWatch).to.equal true expect(options.autoWatchInterval).to.equal 10 diff --git a/test/unit/logger.spec.coffee b/test/unit/logger.spec.coffee index 93dfde21a..c050858e9 100644 --- a/test/unit/logger.spec.coffee +++ b/test/unit/logger.spec.coffee @@ -5,7 +5,7 @@ describe 'logger', -> loadFile = require('mocks').loadFile logSpy = m = null - + beforeEach -> console.log.reset() logSpy = sinon.spy() @@ -20,7 +20,7 @@ describe 'logger', -> type: 'file' filename: 'test/unit/test.log' ] - + expect(m.log4js.appenders).to.have.keys ['console', 'file'] it 'should deactivate the global color', -> @@ -29,13 +29,13 @@ describe 'logger', -> layout: type: 'pattern' ] - - log = m.create('testacular') + + log = m.create('karma') log.on 'log', logSpy log.info 'info' - + expect(logSpy).to.have.been.calledOnce - expect(console.log).to.have.been.calledWith 'INFO [testacular]: info' + expect(console.log).to.have.been.calledWith 'INFO [karma]: info' #============================================================================ @@ -43,15 +43,15 @@ describe 'logger', -> #============================================================================ describe 'create', -> - it 'should allow global logger with default category testacular', -> + it 'should allow global logger with default category karma', -> m.setup 'DEBUG', false log = m.create() log.on 'log', logSpy log.info 'global msg' - + expect(logSpy).to.have.been.calledOnce event = logSpy.lastCall.args[0] - expect(event.categoryName).to.equal 'testacular' + expect(event.categoryName).to.equal 'karma' expect(event.data).to.deep.equal ['global msg'] it 'should use local level without a global configuration', -> @@ -67,5 +67,3 @@ describe 'logger', -> log2.on 'log', logSpy log2.info 'should be here' expect(logSpy).to.have.been.calledOnce - - \ No newline at end of file diff --git a/test/unit/web-server.spec.coffee b/test/unit/web-server.spec.coffee index 6229db59f..b64b1a6d8 100644 --- a/test/unit/web-server.spec.coffee +++ b/test/unit/web-server.spec.coffee @@ -243,7 +243,7 @@ describe 'web-server', -> {path: '/tcular/adapter/c.js', mtime: new Date 321}] response.once 'end', -> - expect(response._content.toString()).to.equal 'window.__testacular__.files = {\n' + + expect(response._content.toString()).to.equal 'window.__karma__.files = {\n' + " '/absolute/some/abs/a.js': '12345',\n" + " '/base/b.js': '67890',\n" + " '/adapter/c.js': '321'\n" +