Last active
May 20, 2017 05:37
-
-
Save fraaalk/56f560309e617e0e85df6bfd336714af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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