Skip to content

Instantly share code, notes, and snippets.

@fraaalk
Last active May 20, 2017 05:37
Show Gist options
  • Select an option

  • Save fraaalk/56f560309e617e0e85df6bfd336714af to your computer and use it in GitHub Desktop.

Select an option

Save fraaalk/56f560309e617e0e85df6bfd336714af to your computer and use it in GitHub Desktop.
const should = require('chai').should();
const sinon = require('sinon');
const proxyquire = require('proxyquire');
describe('movie.js', function() {
const sandbox = sinon.sandbox.create();
let Movie;
beforeEach(function() {
Movie = require('kinoheld/components/movie/movie.js');
proxyquire('movie.js', {
'modal.js': Modal = sandbox.stub(),
});
});
afterEach(function() {
sandbox.restore();
});
it('should create a new modal', function(){
const movie = new Movie();
Modal.callCount.should.equal(1);
});
it('should create a another modal', function(){
const movie = new Movie();
Modal.callCount.should.equal(1);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment