created sample spy test on chrome api

This commit is contained in:
Stephen Rodriguez
2015-07-03 13:14:08 -04:00
parent 9598a53788
commit d6b9ccf640
2 changed files with 18 additions and 2 deletions

View File

@@ -1,10 +1,14 @@
{
"scripts": {
"test": "jest && mocha --compilers js:mocha-traceur tests/**/*.spec.js",
"test-react": "jest",
"test-js": "mocha --compilers js:mocha-traceur tests/**/*.spec.js",
"start": "npm install && bower install && gulp",
"lint": "jsxhint --jsx-only ."
},
"pre-commit": ["lint"],
"pre-commit": [
"lint"
],
"jest": {
"testFileExtensions": [
"jest.js"
@@ -27,7 +31,8 @@
"mocha-traceur": "^2.1.0",
"precommit-hook": "^2.0.1",
"react-tools": "^0.13.3",
"sinon": "^1.14.1"
"sinon": "^1.15.4",
"sinon-chrome": "^0.1.2"
},
"dependencies": {
"bootstrap": "^3.3.4",

View File

@@ -0,0 +1,11 @@
var chai = require('chai');
var sinon = require('sinon');
var chrome = require('sinon-chrome');
var expect = chai.expect;
describe('Chrome Dev Tools', function() {
it('should work', function() {
chrome.browserAction.setTitle({title: 'hello'});
sinon.assert.calledOnce(chrome.browserAction.setTitle);
});
});