Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var assert = require('assert');
- var sinon = require("sinon");
- var testUtil = require('testUtil/testUtil');
- var FileReaderProxy = require('functions/IFileReaderProxy/FileReaderProxy');
- describe('FileReader', ()=> {
- describe("when fetching file path that exist", ()=> {
- describe("Given a file name and encoding", () => {
- testUtil.dataProvider([["config.content", "utf8"]], (expectedPath,expectedEncoding)=> {
- it("should call the injected spy providing it with the parameters.", () => {
- var spyCalledWithParameters;
- const fileReaderSpy = sinon.spy();
- const proxy = FileReaderProxy(fileReaderSpy);
- proxy(expectedPath, expectedEncoding);
- spyCalledWithParameters = fileReaderSpy.calledWith(expectedPath, expectedEncoding);
- assert(spyCalledWithParameters);
- });
- });
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement