I have recently decided to start learning how to write tests. I am using angular so I decided to use karma and mocha to run the tests. I followed this tutorial here: http://ift.tt/1cIQdoP
However it does not work for me. Every time I run the test I get this as my outcome:
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Linux)]: Connected on socket RRl1GLX7HZj_VG8_KSSz with id 13178195
It does not move beyond this point. I think it might be something silly as the code to be tested is an empty file. But seeing as the file is there I thought it would return errors.
Here is my Karma.conf.js file:
describe("A test suite", function() {
beforeEach(function() { });
afterEach(function() { });
it('should fail', function() { expect(true).to.be.false; });
});
Here is my package.json:
{
"name": "testingNew",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "BSD-2-Clause",
"devDependencies": {
"karma": "~0.12.31",
"mocha": "~2.2.4",
"karma-mocha": "~0.1.10",
"chai": "~2.2.0",
"karma-chai": "~0.1.0",
"sinon": "~1.14.1",
"karma-sinon": "~1.0.4",
"karma-phantomjs-launcher": "~0.1.4"
}
}
If anyone has had this problem before or has any ideas on how to fix it that would be greatly appreciated. As always if you need to see more code or get more info in the problem just ask. Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire