created sample spy test on chrome api
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest && mocha --compilers js:mocha-traceur tests/**/*.spec.js",
|
"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",
|
"start": "npm install && bower install && gulp",
|
||||||
"lint": "jsxhint --jsx-only ."
|
"lint": "jsxhint --jsx-only ."
|
||||||
},
|
},
|
||||||
"pre-commit": ["lint"],
|
"pre-commit": [
|
||||||
|
"lint"
|
||||||
|
],
|
||||||
"jest": {
|
"jest": {
|
||||||
"testFileExtensions": [
|
"testFileExtensions": [
|
||||||
"jest.js"
|
"jest.js"
|
||||||
@@ -27,7 +31,8 @@
|
|||||||
"mocha-traceur": "^2.1.0",
|
"mocha-traceur": "^2.1.0",
|
||||||
"precommit-hook": "^2.0.1",
|
"precommit-hook": "^2.0.1",
|
||||||
"react-tools": "^0.13.3",
|
"react-tools": "^0.13.3",
|
||||||
"sinon": "^1.14.1"
|
"sinon": "^1.15.4",
|
||||||
|
"sinon-chrome": "^0.1.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^3.3.4",
|
"bootstrap": "^3.3.4",
|
||||||
|
|||||||
11
tests/helpers/Chrome.spec.js
Normal file
11
tests/helpers/Chrome.spec.js
Normal 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);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user