this.sinon is undefined in Mocha framework when running with Karma

RESOLVED WONTFIX

Status

Firefox OS
Gaia::TestAgent
RESOLVED WONTFIX
4 years ago
2 months ago

People

(Reporter: evanxd, Assigned: Veck Hsiao)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Comment hidden (empty)
Summary: this.sinon is undefined in Mocha framework → this.sinon is undefined in Mocha framework when running with Karma
(Assignee)

Comment 2

4 years ago
Thanks Julien, with help of Ricky, I fixed this problem in apps bluetooth. It's surely resolved with your files in your reply. I'll keep making other files go well.

[1] shows the configure file I modified to work. I should load some file in dev_apps/test-agent, just like you said. And some other problems showed up were resolved in [2]. I also temporarily removed and modified some code for having a test to move them to our karma-test-agent project.

[1]https://github.com/fbukevin/gaia/blob/issue1027475/bluetooth.conf.js
[2]https://github.com/fbukevin/gaia/tree/issue1027475
(Assignee)

Comment 3

4 years ago
I moved some test-agent code that bluetooth unit tests use to a new file test_agent.js and require.js in our project . All the tests with configure file bluetooth.config.js are successful. A new problem I'm fixing is that when I try to add tests of bluetooth in karma.config.js with following file list:
      'apps/video/test/unit/*_test.js',
      'apps/fl/test/unit/*_test.js',
      'apps/fm/test/unit/*_test.js',
      'apps/bluetooth/test/unit/*_test.js',
      { pattern: '+(apps|dev_apps|shared)/**/*.*', watched: false, included: false, served: true }
A new problem appears:

Firefox 35.0.0 (Mac OS X 10.9) Thumbnail Date Group Unit Tests #rendering #normal FAILED
	expected 'Wed Aug 07 2013 18:59:00 GMT+0800 (CST)' to equal '1375873140000,date-group-header'
	chaiAssert@/Users/veck/gaia/node_modules/karma-test-agent/lib/require.js:291:1
	module.exports/assert.equal@/Users/veck/gaia/dev_apps/test-agent/common/vendor/chai/chai.js=1412266463765:1245:1
	@/Users/veck/gaia/apps/video/test/unit/thumbnail_date_group_test.js:132:1
	callFn@/Users/veck/gaia/node_modules/mocha/mocha.js:4338:18
	Runnable.prototype.run@/Users/veck/gaia/node_modules/mocha/mocha.js:4331:7
	Runner.prototype.runTest@/Users/veck/gaia/node_modules/mocha/mocha.js:4728:5
	next/<@/Users/veck/gaia/node_modules/mocha/mocha.js:4806:7
	next@/Users/veck/gaia/node_modules/mocha/mocha.js:4653:1
	next/<@/Users/veck/gaia/node_modules/mocha/mocha.js:4663:7
	next@/Users/veck/gaia/node_modules/mocha/mocha.js:4601:1
	Runner.prototype.hook/<@/Users/veck/gaia/node_modules/mocha/mocha.js:4630:5
	timeslice@/Users/veck/gaia/node_modules/mocha/mocha.js:5763:5
	
Firefox 35.0.0 (Mac OS X 10.9) Video App Unit Tests "before all" hook FAILED
	ReferenceError: initDB is not defined (/Users/veck/gaia/apps/video/js/video.js=6000:155)
	process.on/global.onerror@/Users/veck/gaia/node_modules/mocha/mocha.js:5738:10

But I'm sure without 'apps/bluetooth/test/unit/*_test.js', tests of video, fl, and fm are all passed. Also, the configure file that only contain:
       'apps/bluetooth/test/unit/*_test.js',
      { pattern: '+(apps|dev_apps|shared)/**/*.*', watched: false, included: false, served: true }
is work fine as well.

Comment 5

2 months ago
Firefox OS is not being worked on
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.