Hi Vojta, I hope that you are okI have installed karma-mocha
C:\Program Files\nodejs>npm install karma-mocha --save-dev
npm http GET https://registry.npmjs.org/karma-mocha
npm http 304 https://registry.npmjs.org/karma-mocha
npm http GET https://registry.npmjs.org/karma
npm http GET https://registry.npmjs.org/mocha
npm http 304 https://registry.npmjs.org/karma
npm http 304 https://registry.npmjs.org/mocha
npm http GET https://registry.npmjs.org/growl....I am getting this output in the end
> phan...@1.9.1-8 install C:\Program Files\nodejs\node_modules\karma-phantomjs-launcher\node_modules\phantomjs
> node install.js
PhantomJS detected, but wrong version 1.9.0 @ C:\phantomjs\phantomjs-1.9.0-windows\phantomjs.EXE.
Download already available at \tmp\phantomjs\phantomjs-1.9.1-windows.zip
Extracting zip contents
Renaming extracted folder \tmp\phantomjs\phantomjs-1.9.1-windows -> C:\Program Files\nodejs\node_modules\karma-phantomjs-launcher\node_modules\phanto
Writing location.js file
Done. Phantomjs binary available at C:\Program Files\nodejs\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe
mo...@1.12.1 node_modules\mocha
├── gr...@1.7.0
├── di...@1.0.2
├── comm...@0.6.1
├── de...@0.7.2
├── mkd...@0.3.5
├── ja...@0.26.3 (mkd...@0.3.0)
└── gl...@3.2.1 (inhe...@1.0.0, grace...@1.2.3, mini...@0.2.12)
karma-scri...@0.1.0 node_modules\karma-script-launcher
karma-...@0.1.3 node_modules\karma-jasmine
karma-r...@0.1.0 node_modules\karma-requirejs
karma-chro...@0.1.0 node_modules\karma-chrome-launcher
karma-html2js...@0.1.0 node_modules\karma-html2js-preprocessor
karma-firef...@0.1.0 node_modules\karma-firefox-launcher
karma-coffee...@0.1.0 node_modules\karma-coffee-preprocessor
└── coffee...@1.6.3
karma-phanto...@0.1.0 node_modules\karma-phantomjs-launcher
└── phan...@1.9.1-8 (wh...@1.0.5, mkd...@0.3.5, n...@0.4.2, k...@0.1.7, adm...@0.2.1, rim...@2.0.3, npm...@0.0.24)
ka...@0.10.2 node_modules\karma
├── d...@0.0.1
├── col...@0.6.0-1
├── grace...@1.2.3
├── rim...@2.1.4
├── mi...@1.2.11
├── chok...@0.6.3
├── q...@0.9.6
├── mini...@0.2.12 (sig...@1.0.0, lru-...@2.3.1)
├── gl...@3.1.21 (inhe...@1.0.0)
├── coffee...@1.6.3
├── user...@2.0.7 (lru-...@2.2.4)
├── lod...@1.1.1
├── opti...@0.3.7 (word...@0.0.2)
├── log...@0.6.8 (deq...@1.0.3, as...@0.1.15, sem...@1.1.4, readabl...@1.0.17)
├── con...@2.8.8 (ui...@0.0.2, met...@0.0.1, cookie-s...@1.0.1, pa...@0.0.1, fr...@0.2.0, by...@0.2.0, buffer...@0.2.1, q...@0.6.5, debug@0.7.
├── http-...@0.10.3 (pkg...@0.2.3, ut...@0.1.7)
└── sock...@0.9.16 (base...@0.1.0, polic...@0.0.4, re...@0.7.3, socket.i...@0.9.16)
karma...@0.1.0 node_modules\karma-mocha
C:\Program Files\nodejs>:* I have this Karma config file:module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '../',
frameworks: ['mocha'],
// list of files / patterns to load in the browser
files : [
'app/lib/angular/angular.js',
'app/lib/angular/angular-*.js',
'test/lib/angular/angular-mocks.js',
'app/js/**/*.js',
'test/unit/mocha/**/*.js'
],
// list of files to exclude
exclude: [],
// use dots reporter, as travis terminal does not support escaping sequences
// possible values: 'dots', 'progress'
// CLI --reporters progress
reporters: ['progress', 'junit'],
junitReporter: {
// will be resolved to basePath (in the same way as files/exclude patterns)
outputFile: 'test-results.xml'
},
// web server port
// CLI --port 9876
port: 9876,
// enable / disable colors in the output (reporters and logs)
// CLI --colors --no-colors
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
// CLI --log-level debug
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
// CLI --auto-watch --no-auto-watch
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
// CLI --browsers Chrome,Firefox,Safari
browsers: [process.env.TRAVIS ? 'Firefox' : 'Chrome'],
// If browser does not capture in given timeout [ms], kill it
// CLI --capture-timeout 5000
captureTimeout: 20000,
// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: false,
// report which specs are slower than 500ms
// CLI --report-slower-than 500
reportSlowerThan: 500,
// compile coffee scripts
preprocessors: {
'**/*.coffee': 'coffee'
},
plugins: [
'karma-jasmine',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-junit-reporter'
]
});
};* when I try to run my tests I am getting this error:C:\angular-phonecat\test>karma start karma-mocha.conf.js
WARN [plugin]: Cannot find plugin "karma-junit-reporter".
Did you forget to install it ?
npm install karma-junit-reporter --save-dev
WARN [reporter]: Can not load "junit", it is not registered!
Perhaps you are missing some plugin?
C:\angular-phonecat\test\node_modules\karma\node_modules\di\lib\injector.js:9
throw error('No provider for "' + name + '"!');
^
Error: No provider for "framework:mocha"! (Resolving: framework:mocha)
at error (C:\angular-phonecat\test\node_modules\karma\node_modules\di\lib\injector.js:22:68)
at Object.parent.get (C:\angular-phonecat\test\node_modules\karma\node_modules\di\lib\injector.js:9:13)
at get (C:\angular-phonecat\test\node_modules\karma\node_modules\di\lib\injector.js:54:19)
at C:\angular-phonecat\test\node_modules\karma\lib\server.js:28:14
at Array.forEach (native)
at start (C:\angular-phonecat\test\node_modules\karma\lib\server.js:27:21)
at invoke (C:\angular-phonecat\test\node_modules\karma\node_modules\di\lib\injector.js:75:15)
at Object.exports.start (C:\angular-phonecat\test\node_modules\karma\lib\server.js:204:12)
at Object.<anonymous> (C:\Users\U8011982\AppData\Roaming\npm\node_modules\karma\bin\karma:19:39)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3Can you help? :) thanks in advance
Hi Vojta, have you come accross issues using requirejs on angular e2e tests?
I can see the require js modules being loaded into the test. but they are not in the scope of angular scenario. I understand that angular e2e tests run on an iframe. has that got something to do with it?
Nevertheless even when I try:
expect(window).not().toBe(undefined);
it fails. how can I make the requirejs modules available to angular-scenario's context?
best regards,
David
Sent: Thursday, September 12, 2013 11:26 AM
Subject: Re: browserstack-launcher
yep, thanks :)
Also I had to upgrade the browserStack jar to the latest too :)
I think there was not enough login info to see this so I had to add extra loging info to the browserStack-launcher js code.
all the best,
David
Sent: Thursday, September 12, 2013 12:36 AM
Subject: Re: browserstack-launcher
Cool, glad it works.It means that compilation of some native module failed. That does not surprise me at all on Windows ;-) Most of the native modules have JS fallback version, so it should work even without compiling the native module.
V.