Closed ghost closed 6 years ago
const chrome = require( 'sinon-chrome' ); const chai = require( 'chai' ); chai.use( require( 'sinon-chai' ) ); const expect = chai.expect; expect( chrome.storage.sync.get ).not.to.equal( chrome.storage.local.get ); // fails, these are equal expect( chrome.storage.sync.get ).not.to.have.been.called; expect( chrome.storage.local.get ).not.to.have.been.called; chrome.storage.sync.get( 'test' ); expect( chrome.storage.sync.get ).to.have.been.called; expect( chrome.storage.local.get ).not.to.have.been.called; // fails
I found this after hours of trying to figure out why my test was failing where I was testing that my extension loads from sync storage and not from local storage.
I found this after hours of trying to figure out why my test was failing where I was testing that my extension loads from sync storage and not from local storage.