I've been going nuts trying to figure this out:
All I want to do it access my site.js file and run a function in it from within my Jasmine unit test.
Here is my code:
site.js
function GetImageContainers() {
}
Test.js
/// <reference path="../site.js" />
describe("Portfolio Image Resizing", function() {
it("Retreive List of images in the images folder", function() {
var images = GetImageContainers();
expect(images).toEqual(jasmine.any(Number));
});
it("1 Image should fill the entire space available, whilst keeping aspect equal", function() {
});
});
The error that comes up when I run the tests says that GetImageContainers is undefined. I've tried using require(...) but then it says that 'require' is undefined as well.
(I'm very new to JS btw so it could be a stupid syntax error or something)
any help is appreciated!