deftjs / DeftJS

Extensions for Large-Scale Sencha Touch and Ext JS Applications
http://deftjs.org/
MIT License
285 stars 56 forks source link

Update Karma configurations from v0.8 -> v0.10 syntax #115

Closed asiragusa closed 10 years ago

asiragusa commented 11 years ago

I tried to run the tests with karma via commandline, but they failed with the following error:

$ sencha ant test
Sencha Cmd v3.1.2.342
[INF] 
[INF] test:
[INF] 
[INF] test:
[INF]      [echo] Performing Deft JS unit tests with the following browsers: Chrome,Safari,Firefox.
[INF]      [echo] Ext JS 4.0.7
[INF]      [exec] WARN [config]: MOCHA is not supported anymore.
[INF]      [exec]   Please use `frameworks = ["mocha"];` instead.
[INF]      [exec] WARN [config]: MOCHA_ADAPTER is not supported anymore.
[INF]      [exec]   Please use `frameworks = ["mocha"];` instead.
[INF]      [exec] WARN [config]: LOG_INFO is not supported anymore.
[INF]      [exec]   Please use `karma.LOG_INFO` instead.
[INF]      [exec] ERROR [config]: Config file must export a function!
[INF]      [exec]   module.exports = function(config) '{'
[INF]      [exec]     config.set('{'
[INF]      [exec]       // your config
[INF]      [exec]     '}');
[INF]      [exec]   '}';
[INF]      [exec] 
[ERR] The following error occurred while executing this line:
/Library/WebServer/deftJSMaster/packages/deft/test/build.xml:14: exec returned: 1

The problem sits in the config files format that maybe changed in the meantime. See http://karma-runner.github.io/0.10/config/configuration-file.html

The header of the config files says that it's an autogenerated file, but I couldn't find the sources.

Can you please fix the config file format and put the source file in the git repository?

johnyanarella commented 10 years ago

I have updated the Karma test configurations to the new v0.10 format.

Karma has been split up into smaller plugins, so package.json has been updated to include the plugins we use in the devDependencies section.

Karma v0.10 uses a newer build of Mocha, so several other updates and tweaks were required. All of the third-party libraries have been updated to their latest versions (chai, sinon, sinon-chai, mocha-as-promised, chai-as-promised). Because chai-as-promised requires that any custom Chai assertions be registered before that script is included, the custom assertions used in the Promise tests have been moved out to test/support/custom-assertions.js and associated tests to `test/coffee/custom-assertions.coffee'.

Travis-CI has a 4MB limit for log files. With the progress reporter, we were exceeding that limit. I switched to the dots reporter. This ends up making the log file much more readable and less overwhelming anyway.